Skip to content

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

Closed
@deusaquilus

Description

@deusaquilus

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions