Skip to content

Commit ba74b34

Browse files
committed
Improve comments
1 parent 942897d commit ba74b34

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,15 @@ object Types {
18881888
case st => st
18891889
}
18901890

1891-
/** Same as superType, except that opaque types are treated as transparent aliases */
1891+
/** Same as superType, except for two differences:
1892+
* - opaque types are treated as transparent aliases
1893+
* - applied type are matchtype-reduced if possible
1894+
*
1895+
* Note: the reason to reduce match type aliases here and not in `superType`
1896+
* is that `superType` is context-independent and cached, whereas matchtype
1897+
* reduction depends on context and should not be cached (at least not without
1898+
* the very specific cache invalidation condition for matchtypes).
1899+
*/
18921900
def translucentSuperType(using Context): Type = superType
18931901
}
18941902

0 commit comments

Comments
 (0)