Skip to content

Commit 3dc3ccb

Browse files
committed
Workaround for type propagation error
We had ``` def classSymbols(implicit ctx: Context): List[ClassSymbol] = parentSymbols(_.isClass).asInstanceOf ``` Under significant indentation, the body of the method is conceptually a block. That causes the type parameter of `asInstanceOf` to be inferred to `Nothing` instead of `List[ClassSymbol]`. The same effect occurs if we enclose the body in braces (even under -noindent). I will try to fix the type propagation fail in a separate commit. This here is a workaround.
1 parent 8035050 commit 3dc3ccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ object Types {
458458
/** The least (wrt <:<) set of class symbols of which this type is a subtype
459459
*/
460460
final def classSymbols(implicit ctx: Context): List[ClassSymbol] =
461-
parentSymbols(_.isClass).asInstanceOf
461+
parentSymbols(_.isClass).asInstanceOf[List[ClassSymbol]]
462462

463463
/** The term symbol associated with the type */
464464
@tailrec final def termSymbol(implicit ctx: Context): Symbol = this match {

0 commit comments

Comments
 (0)