Skip to content

Commit 9eee92f

Browse files
committed
Fix of too strict variance checking.
When following an alias type, go directly to aliased type. Going via the TypeAlias link causes the current variance ot be narrowed to 0.
1 parent 25f3858 commit 9eee92f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/typer/VarianceChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class VarianceChecker()(implicit ctx: Context) {
8484
case tp: TypeRef =>
8585
val sym = tp.symbol
8686
if (sym.variance != 0 && base.isContainedIn(sym.owner)) checkVarianceOfSymbol(sym)
87-
else if (sym.isAliasType) this(status, sym.info)
87+
else if (sym.isAliasType) this(status, sym.info.bounds.hi)
8888
else foldOver(status, tp)
8989
case tp: MethodType =>
9090
this(status, tp.resultType) // params will be checked in their TypeDef nodes.

0 commit comments

Comments
 (0)