-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Scala2 / 3 handles type argument differently #12953
Comments
It works for me without error. |
@odersky I tried it and it doesn't work for me either |
I tested this with the latest master |
I had a stray |
So, yes, that's right now simply not supported. Here's what it says for the method that computes the context to be used for an annotation /** The context to be used for an annotation of `mdef`.
* This should be the context enclosing `mdef`, or if `mdef` defines a parameter
* the context enclosing the owner of `mdef`.
* Furthermore, we need to evaluate annotation arguments in an expression context,
* since classes defined in a such arguments should not be entered into the
* enclosing class.
*/
def annotContext(mdef: untpd.Tree, sym: Symbol)(using Context): Context = {
def isInner(owner: Symbol) = owner == sym || sym.is(Param) && owner == sym.owner
val outer = ctx.outersIterator.dropWhile(c => isInner(c.owner)).next()
outer.property(ExprOwner) match {
case Some(exprOwner) if outer.owner.isClass => outer.exprContext(mdef, exprOwner)
case _ => outer
}
} It will take some effort to change this |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 29, 2021
BarkingBad
pushed a commit
to BarkingBad/dotty
that referenced
this issue
Jul 23, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.0.1.RC-2
Minimized code
Output
Expectation
It should compile, since it does on Scala 2.13.6.
The text was updated successfully, but these errors were encountered: