File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1992,8 +1992,12 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1992
1992
val isExpr2 = info2.isInstanceOf [ExprType ]
1993
1993
val info1 = m.info match
1994
1994
case info1 : ValueType if isExpr2 || m.symbol.is(Mutable ) =>
1995
- ExprType (info1)
1995
+ // OK: { val x: T } <: { def x: T }
1996
+ // OK: { var x: T } <: { def x: T }
1997
+ // NO: { var x: T } <: { val x: T }
1998
+ ExprType (info1)
1996
1999
case info1 @ MethodType (Nil ) if isExpr2 && m.symbol.is(JavaDefined ) =>
2000
+ // OK{ { def x(): T } <: { def x: T} // if x is Java defined
1997
2001
ExprType (info1.resType)
1998
2002
case info1 => info1
1999
2003
isSubInfo(info1, info2, m.symbol.info.orElse(info1))
You can’t perform that action at this time.
0 commit comments