Skip to content

inline with @targetName and -Ycheck:all causes AssertionError #11731

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
deusaquilus opened this issue Mar 14, 2021 · 1 comment · Fixed by #11927
Closed

inline with @targetName and -Ycheck:all causes AssertionError #11731

deusaquilus opened this issue Mar 14, 2021 · 1 comment · Fixed by #11927
Assignees
Milestone

Comments

@deusaquilus
Copy link
Contributor

Compiler version

3.0.0-RC2-bin-20210312-a3b98ac-NIGHTLY

Minimized code

@targetName("funfun")
inline def fun: Unit = ???

Output

[info] checking /Users/aleiof/git/ycheckall_issue/src/main/scala/io/getquill/mytest/Example.scala after phase erasure
exception while typing @scala.annotation.internal.SourceFile(
  "src/main/scala/io/getquill/mytest/Example.scala"
) trait Example() extends Object {} of class class dotty.tools.dotc.ast.Trees$TypeDef # -1
exception while typing package io.getquill.mytest {
  @scala.annotation.internal.SourceFile(
    "src/main/scala/io/getquill/mytest/Example.scala"
  ) trait Example() extends Object {}
} of class class dotty.tools.dotc.ast.Trees$PackageDef # -1
*** error while checking /Users/aleiof/git/ycheckall_issue/src/main/scala/io/getquill/mytest/Example.scala after phase erasure ***
[info] exception occurred while compiling /Users/aleiof/git/ycheckall_issue/src/main/scala/io/getquill/mytest/Example.scala
java.lang.AssertionError: assertion failed:  trait Example tree does not define members: method fun
expected: constructor Example, method fun
defined:  while compiling /Users/aleiof/git/ycheckall_issue/src/main/scala/io/getquill/mytest/Example.scala
[error] ## Exception when compiling 1 sources to /Users/aleiof/git/ycheckall_issue/target/scala-3.0.0-RC2/classes
[error] java.lang.AssertionError: assertion failed:  trait Example tree does not define members: method fun
[error] expected: constructor Example, method fun
[error] defined: 
[error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
[error] dotty.tools.dotc.transform.TreeChecker$Checker.typedClassDef(TreeChecker.scala:457)
[error] dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2623)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2627)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2696)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:118)

Expectation

Code should compile and run normally.

Repo

Can be found here:
https://github.com/deusaquilus/ycheckall_issue

@deusaquilus
Copy link
Contributor Author

deusaquilus commented Mar 14, 2021

@nicolasstucki Btw, this is based on the -Ycheck:all issue you mentioned earlier in Quill #11611.

@liufengyun liufengyun self-assigned this Mar 22, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 29, 2021
The symbol might have original name in scope other than its current
target name (after erasure).
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 29, 2021
The symbol might have original name in scope other than its current
target name (after erasure).
smarter added a commit that referenced this issue Mar 30, 2021
Fix #11731: Remove symbols with targetName correctly
michelou pushed a commit to michelou/scala3 that referenced this issue Mar 30, 2021
The symbol might have original name in scope other than its current
target name (after erasure).
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 6, 2021
The symbol might have original name in scope other than its current
target name (after erasure).
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 14, 2021
The symbol might have original name in scope other than its current
target name (after erasure).
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants