We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f29013c commit a4e22b1Copy full SHA for a4e22b1
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -1992,8 +1992,12 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1992
val isExpr2 = info2.isInstanceOf[ExprType]
1993
val info1 = m.info match
1994
case info1: ValueType if isExpr2 || m.symbol.is(Mutable) =>
1995
- ExprType(info1)
+ // 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)
1999
case info1 @ MethodType(Nil) if isExpr2 && m.symbol.is(JavaDefined) =>
2000
+ // OK{ { def x(): T } <: { def x: T} // if x is Java defined
2001
ExprType(info1.resType)
2002
case info1 => info1
2003
isSubInfo(info1, info2, m.symbol.info.orElse(info1))
0 commit comments