-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #6988: add test #7009
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
Fix #6988: add test #7009
Conversation
Literal(Constant(value)).seal.asInstanceOf[Expr[String]] | ||
val paramss = enclosingParamList(rootContext.owner) | ||
val firstArg = paramss.flatten.head | ||
val ref = Select.unique(This(enclosingCls), firstArg.name) |
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.
Not sure if this is a fix, since my report is about Ref(...)
not working.
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.
The issue is not with Ref
, but about compiler internals: at the code place & pickling phase where we refer to the constructor param symbol, it's simply not accessible.
After the compiler phases that actually create primary constructors, the code might work, but it's far after pickling.
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.
We should also have an assertion inside Ref
to prevent the creation of an inconsistent ref.
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.
I don't think it's practical to add checks in Ref
--- it works as expected, it's where we put the tree result in pickling crash.
@liufengyun @nicolasstucki Can we resolve this before the release? |
Just checked, with the original code, java.lang.AssertionError: assertion failed: undefined symbol value p1 at line 25 while compiling tests/neg/6988/Test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: undefined symbol value p1 at line 25
at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
at dotty.tools.dotc.transform.TreeChecker$Checker.assertDefined(TreeChecker.scala:204)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedIdent(TreeChecker.scala:339) |
@liufengyun there is still some syntax to update |
Fix #6988: add test