@@ -1183,7 +1183,7 @@ object Types {
1183
1183
// That's why the branch is disabled.
1184
1184
//
1185
1185
// else if (ctx.erasedTypes && lastSymbol != null)
1186
- // denotOfSym(lastSymbol)
1186
+ // denotOfSym(lastSymbol)
1187
1187
else
1188
1188
d.current
1189
1189
}
@@ -1516,7 +1516,7 @@ object Types {
1516
1516
* signature, if denotation is not yet completed.
1517
1517
*/
1518
1518
def apply (prefix : Type , name : TermName , denot : Denotation )(implicit ctx : Context ): TermRef = {
1519
- if ((prefix eq NoPrefix ) || denot.symbol.isFresh)
1519
+ if ((prefix eq NoPrefix ) || denot.symbol.isFresh || ctx.erasedTypes )
1520
1520
apply(prefix, denot.symbol.asTerm)
1521
1521
else denot match {
1522
1522
case denot : SymDenotation if denot.isCompleted => withSig(prefix, name, denot.signature)
@@ -1538,7 +1538,7 @@ object Types {
1538
1538
* (2) The name in the term ref need not be the same as the name of the Symbol.
1539
1539
*/
1540
1540
def withSymAndName (prefix : Type , sym : TermSymbol , name : TermName )(implicit ctx : Context ): TermRef =
1541
- if ((prefix eq NoPrefix ) || sym.isFresh)
1541
+ if ((prefix eq NoPrefix ) || sym.isFresh || ctx.erasedTypes )
1542
1542
withFixedSym(prefix, name, sym)
1543
1543
else if (sym.defRunId != NoRunId && sym.isCompleted)
1544
1544
withSig(prefix, name, sym.signature) withSym (sym, sym.signature)
@@ -1549,7 +1549,7 @@ object Types {
1549
1549
* (which must be completed).
1550
1550
*/
1551
1551
def withSig (prefix : Type , sym : TermSymbol )(implicit ctx : Context ): TermRef =
1552
- if ((prefix eq NoPrefix ) || sym.isFresh) withFixedSym(prefix, sym.name, sym)
1552
+ if ((prefix eq NoPrefix ) || sym.isFresh || ctx.erasedTypes ) withFixedSym(prefix, sym.name, sym)
1553
1553
else withSig(prefix, sym.name, sym.signature).withSym(sym, sym.signature)
1554
1554
1555
1555
/** Create a term ref with given prefix, name and signature */
@@ -1558,7 +1558,7 @@ object Types {
1558
1558
1559
1559
/** Create a term ref with given prefix, name, signature, and initial denotation */
1560
1560
def withSigAndDenot (prefix : Type , name : TermName , sig : Signature , denot : Denotation )(implicit ctx : Context ): TermRef = {
1561
- if ((prefix eq NoPrefix ) || denot.symbol.isFresh)
1561
+ if ((prefix eq NoPrefix ) || denot.symbol.isFresh || ctx.erasedTypes )
1562
1562
withFixedSym(prefix, denot.symbol.asTerm.name, denot.symbol.asTerm)
1563
1563
else
1564
1564
withSig(prefix, name, sig)
0 commit comments