Skip to content
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

Experiment: Encode annotations with a specialized representation #21948

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbovel
Copy link
Member

@mbovel mbovel commented Nov 14, 2024

[skip ci]

@mbovel
Copy link
Member Author

mbovel commented Nov 14, 2024

Currently failing tests

tests/neg/i4373.scala:

assertion failed: Ident(<error>)testOnly 36s
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
        at dotty.tools.dotc.core.SimpleExprs$.fromTree(SimpleExprs.scala:47)
        at dotty.tools.dotc.core.SimpleExprs$.fromTree(SimpleExprs.scala:54)
        at dotty.tools.dotc.core.SimpleExprs$.fromTree(SimpleExprs.scala:50)
        at dotty.tools.dotc.core.Annotations$Annotation$.apply(Annotations.scala:226)
        at dotty.tools.dotc.typer.TypeAssigner.assignType(TypeAssigner.scala:563)
        at dotty.tools.dotc.typer.TypeAssigner.assignType$(TypeAssigner.scala:16)
        at dotty.tools.dotc.typer.Typer.assignType(Typer.scala:148)
        at dotty.tools.dotc.typer.Typer.typedAnnotated(Typer.scala:3323)
        at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3535)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3585)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3662)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3666)
        at dotty.tools.dotc.typer.Typer.typedType(Typer.scala:3780)
        at dotty.tools.dotc.typer.Namer.typedAheadType$$anonfun$1(Namer.scala:1762)
        at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1755)
        at dotty.tools.dotc.typer.Namer.typedAheadType(Namer.scala:1762)
        at dotty.tools.dotc.typer.Namer$TypeDefCompleter.typeSig(Namer.scala:1093)
        at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:990)
        at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:859)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:175)
        at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:190)
        at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:192)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:393)
        at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:3447)
        at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3472)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3584)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3662)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3666)
        at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3688)
        at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3734)
        at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:3167)
        at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:3488)

tests/neg/nowarn.scala:

Invalid message filter / Test / testOnly 68s
unknown filter: wat?
filter needs to be a compile-time constant string
filter needs to be a compile-time constant string

tests/neg/instantiateAbstract.scala:

Errors found on incorrect row numbers when compiling tests/neg/instantiateAbstract.scala
-> following the errors: Test / testOnly 127s
 at 0: Annotation is abstract; it cannot be instantiated
 at 9: Annotation is abstract; it cannot be instantiated
 at 16: Annotation is abstract; it cannot be instantiated
 at 17: Annotation is abstract; it cannot be instantiated
 at 18: Annotation is abstract; it cannot be instantiated
 at 23: AA is abstract; it cannot be instantiated
 at 25: TT is a trait; it cannot be instantiated
 at 27: A does not conform to its self type B; cannot be instantiated

tests/neg/repeatable:

-> following the errors:
 at 0: Not repeatable annotation repeated
 at 0: Container must not be present at the same time as the element it contains
 at 0: Container must not be present at the same time as the element it contains

tests/run/t6380.scala:

did not match check file. Actual output:
List(class java.lang.Exception) testOnly 265s
List(class java.lang.Throwable)
List(class java.lang.RuntimeException)
List(class java.lang.IllegalArgumentException, class java.util.NoSuchElementException)
List(class java.lang.IndexOutOfBoundsException)
List(class java.lang.IllegalStateException, class java.lang.IllegalStateException)
List(class java.lang.NullPointerException, class java.lang.NullPointerException)

tests/pos/i20901:3144/4685:

TASTy printer difference for class Foo in tests/pos/i20901/Foo.scala, did not match tests/pos/i20901/Foo.tastycheck,
  output dumped in after-printing.txt, check diff with `git diff --no-index -- tests/pos/i20901/Foo.tastycheck after-printing.txt`
  actual output:
Header:
  version: <elided>
  tooling: <elided>
     UUID: <elided>

Names (276 bytes, starting from <elided base index>):
     0: ASTs
     1: <empty>
     2: scala
     3: reflect
     4: scala[Qualified . reflect]
     5: ClassTag
     6: Foo
     7: <init>
     8: java
     9: lang
    10: java[Qualified . lang]

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.

1 participant