File tree 1 file changed +12
-0
lines changed
compiler/src/dotty/tools/dotc/ast
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,18 @@ object desugar {
93
93
def completeConstructor (sym : Symbol ) =
94
94
sym.infoOrCompleter match {
95
95
case completer : Namer # ClassCompleter =>
96
+ // An example, derived from tests/run/t6385.scala
97
+ //
98
+ // class Test():
99
+ // def t1: Foo = Foo(1)
100
+ // final case class Foo(value: Int)
101
+ //
102
+ // Here's the sequence of events:
103
+ // * The symbol for Foo.apply is forced to complete
104
+ // * The symbol for the `value` parameter of the apply method is forced to complete
105
+ // * Completing that value parameter requires typing its type, which is a DerivedTypeTrees,
106
+ // which only types if it has an OriginalSymbol.
107
+ // * So if the case class hasn't been completed, we need (at least) its constructor to be completed
96
108
completer.completeConstructor(sym)
97
109
case _ =>
98
110
}
You can’t perform that action at this time.
0 commit comments