-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Don't force NamedType denotations in containsRefinedThis #1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/rebuild |
It was a GC overhead limit exceeded again. Is there a way to increase the heap or alternatively reduce the level of parallelism? |
Out of heap space this time. We need to change the build script to take more heap. Can someone do this please? |
I think this PR only addresses the symptoms and not the root of the problem, which is that we do not check for cycles in the prefixes of TypeRefs which are RefinementTypes. For example, the following causes an infinite loop instead of printing trait Foo[T <: Bar[T]#Elem]
trait Bar[T] {
type Elem = T
} |
The two problems are unrelated. #974 caused the StackOverflow before the On Thu, Jan 14, 2016 at 5:05 PM, Guillaume Martres <[email protected]
Martin Odersky |
Are you sure? If I apply the following on top of master: https://github.com/dotty-staging/dotty/commits/try/refinement-cycles then |
@smarter Maybe you are right. I fixed checkNonCyclic and your example compiles OK (i.e. with errors) now. |
The heap problem has gone away. We are back to the previous pos/printing: compilation failed without any further diagnostic. It's super urgent that we fix this, no progress is possible without it. |
/rebuild |
@odersky : Maybe try rebasing on master where the partest jenkins job does not use bootstrapped dotty anymore. |
Ok. I was able to get to the archives of workspace. where printing-pos failed, the compiler output only contains:
Not informative. |
To get the archive of workspace:
|
So should we revert the original fix since it's not actually needed? |
trait Bar[T] { | ||
type Elem = T | ||
} | ||
trait Foo2[T <: Bar2[T]#Elem] // error: illegal cyclic reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to have the same test twice, with just the names changed? (Foo -> Foo2
, Bar -> Bar2
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because 1 expected error also succeeds if the file is not found.
@smarter I think the checkNonCyclic fix is worth doing anyway. |
You mean the containsRefinedThis fix, right? Anyway, LGTM once the tests pass. |
@DarkDimius : looking at https://github.com/lampepfl/dotty/blob/master/test/dotty/partest/DPDirectCompiler.scala#L29 I see that it's trying to redirect the output by using a custom Context, but using a custom Context is currently broken, so I don' t think that can work: https://github.com/lampepfl/dotty/blob/da661c8a509efaa1c0ff926b0907c32cd37708a5/src/dotty/tools/dotc/Driver.scala#L37-L39 |
Actually, there's a missing change: remove the comment at https://github.com/lampepfl/dotty/pull/1026/files#diff-2fe35c59082b97d7128120593f9ec2e7R172 about |
/rebuild |
containsRefinedThis inspects symbols and infos of named types in order to avoid needless traversals. As i974 shows, this can lead to infinite recursions. The fix is not to force a NamedType denotation, assume the worst and traverse the prefix if a NamedType is not yet populated with a denotation. Fixes scala#974 and makes MutableSortedSetFactory in stdlib compile.
Previous jenkins run did not run out of memory but ran very slowly, indicating trashing. Trying with half the heap size.
Leaving some last stop to print something even for fatal exceptions.
Need to also look info refined types. Need to handle case where we hit a NoCompleter again.
I observed in a local partest a file with was a java.io.Path, not an SFile. They should be treated like SFiles. Not clear why this came up. The file in question (partest-generated/pos/Patterns_v1.scala) looked just like all the others that were read as SFiles.
(reverted from commit a7bc089)
Superseded by #1028 |
containsRefinedThis inspects symbols and infos of named types in order
to avoid needless traversals. As i974 shows, this can lead to infinite
recursions. The fix is not to force a NamedType denotation, assume the
worst and traverse the prefix if a NamedType is not yet populated
with a denotation.
Fixes #974 and makes MutableSortedSetFactory in stdlib compile.
Review by @smarter