Skip to content

Fix/#55 #56 modules #59

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

Closed
wants to merge 3 commits into from
Closed

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 12, 2014

Fixes for problems related to modules.

odersky added 2 commits March 12, 2014 16:36
Needs new TypeRef creation method that works for NoPrefix and at the same time
does not need a denotation. This is provided by method TermRef.withNakedSymbol.
Distringuish between ModifierFlags -- which can appear in trees -- and SourceModifierFlags -- which are
modifiers according to the language spec.
@odersky
Copy link
Contributor Author

odersky commented Mar 12, 2014

Review by @DarkDimius, @sjrd

@DarkDimius
Copy link
Contributor

Unfortunately #56 isn't fixed yet.
While trying to create object A{} after class A{} in such code
class D {def p = {class A{}; 1}}
I've got an assertion failure

[error]     at scala.Predef$.assert(Predef.scala:155)
[error]     at dotty.tools.dotc.core.Types$CachedTermRef.<init>(Types.scala:1186)
[error]     at dotty.tools.dotc.core.Uniques$NamedTypeUniques.newType$1(Uniques.scala:59)
[error]     at dotty.tools.dotc.core.Uniques$NamedTypeUniques.enterIfNew(Uniques.scala:63)
[error]     at dotty.tools.dotc.core.Types$TermRef$.apply(Types.scala:1211)
[error]     at dotty.tools.dotc.core.Symbols$$anonfun$newCompleteModuleSymbol$1.apply(Symbols.scala:160)
[error]     at dotty.tools.dotc.core.Symbols$$anonfun$newCompleteModuleSymbol$1.apply(Symbols.scala:159)
[error]     at dotty.tools.dotc.core.Symbols$class.newModuleSymbol(Symbols.scala:132)
[error]     at dotty.tools.dotc.core.Contexts$Context.newModuleSymbol(Contexts.scala:50)
[error]     at dotty.tools.dotc.core.Symbols$class.newCompleteModuleSymbol(Symbols.scala:157)
[error]     at dotty.tools.dotc.core.Contexts$Context.newCompleteModuleSymbol(Contexts.scala:50)
[error]     at dotty.tools.dotc.transform.PostTyperTransformers$PostTyperTransformer.reorder0$1(PostTyperTransformers.scala:57)

@DarkDimius
Copy link
Contributor

to experience that failure you can run
testOnly test.transform.PostTyperTransformerTest
on this branch
https://github.com/DarkDimius/dotty/tree/issue56

Need a fix analogous to what was done in newModuleSymbol to determine the source module of
a module class.
DarkDimius added a commit to DarkDimius/dotty that referenced this pull request Mar 12, 2014
@DarkDimius
Copy link
Contributor

Works for me.
LGTM, but better to squash commits before merging.

@DarkDimius
Copy link
Contributor

@odersky, thanks for fixing this quickly.

@odersky
Copy link
Contributor Author

odersky commented Mar 12, 2014

@DarkDimius can you squash the commits and merge? I am overwhelmed with other stuff.

@DarkDimius
Copy link
Contributor

No problem, I'll do it.
I'll create a pull request for PostTyperTranformer, including those your fixes as a separate commit.

@odersky
Copy link
Contributor Author

odersky commented Mar 12, 2014

OK, sounds good

@DarkDimius
Copy link
Contributor

merged as part of #64

@DarkDimius DarkDimius closed this Mar 14, 2014
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this pull request Mar 19, 2025
Backport "Fix enclosingClass from returning refinement classes" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants