Skip to content

Private opaque type in class #14660

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
prolativ opened this issue Mar 10, 2022 · 0 comments · Fixed by #14666
Closed

Private opaque type in class #14660

prolativ opened this issue Mar 10, 2022 · 0 comments · Fixed by #14666

Comments

@prolativ
Copy link
Contributor

Compiler version

3.0.0...3.1.2-RC2

Minimized code

class Bar:
  private opaque type Baz = Int

Output (click arrow to expand)

error while transforming type Baz = Int
error while transforming () extends Object() {
  type Baz = Int
}
error while transforming @SourceFile("/var/folders/rp/f9y80jvs54lcy26rxnt2y2kw0000gn/T/NoOwner.scala") 
  opaque
 class Bar() extends Object() {
  type Baz = Int
}
error while transforming package <empty> {
  @SourceFile("/var/folders/rp/f9y80jvs54lcy26rxnt2y2kw0000gn/T/NoOwner.scala") 
    opaque
   class Bar() extends Object() {
    type Baz = Int
  }
}
exception occurred while compiling /var/folders/rp/f9y80jvs54lcy26rxnt2y2kw0000gn/T/NoOwner.scala
java.lang.AssertionError: NoDenotation.owner while compiling /var/folders/rp/f9y80jvs54lcy26rxnt2y2kw0000gn/T/NoOwner.scala
Exception in thread "main" java.lang.AssertionError: NoDenotation.owner
        at dotty.tools.dotc.core.SymDenotations$NoDenotation$.owner(SymDenotations.scala:2495)
        at dotty.tools.dotc.core.Symbols$Symbol.retainsDefTree(Symbols.scala:87)
        at dotty.tools.dotc.core.Symbols$Symbol.defTree_$eq(Symbols.scala:79)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.processMemberDef(PostTyper.scala:142)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:386)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStat$1(MacroTransform.scala:39)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats$$anonfun$1(MacroTransform.scala:42)
        at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:92)
        at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:108)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats(MacroTransform.scala:42)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transformStats(PostTyper.scala:460)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:58)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform$$anonfun$4$$anonfun$1(PostTyper.scala:351)
        at dotty.tools.dotc.transform.SuperAccessors.wrapTemplate(SuperAccessors.scala:210)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform$$anonfun$4(PostTyper.scala:351)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.withNoCheckNews(PostTyper.scala:98)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:353)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1466)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:386)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStat$1(MacroTransform.scala:39)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats$$anonfun$1(MacroTransform.scala:42)
        at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:92)
        at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:108)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats(MacroTransform.scala:42)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transformStats(PostTyper.scala:460)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1477)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
        at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:451)
        at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:21)
        at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:308)
        at scala.collection.immutable.List.map(List.scala:246)
        at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:309)
        at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:259)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1328)
        at dotty.tools.dotc.Run.runPhases$1(Run.scala:270)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:278)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:287)
        at dotty.tools.dotc.Run.compileSources(Run.scala:220)
        at dotty.tools.dotc.Run.compile(Run.scala:204)
        at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
        at dotty.tools.dotc.Driver.process(Driver.scala:199)
        at dotty.tools.dotc.Driver.process(Driver.scala:167)
        at dotty.tools.dotc.Driver.process(Driver.scala:179)
        at dotty.tools.dotc.Driver.main(Driver.scala:209)
        at dotty.tools.dotc.Main.main(Main.scala)
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