You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: type mismatch:
found : => _$hk$0(M[X]#x)
required: X
def flatMap[X,Y,M[X]<:Monad[X]](m: M[X], f: X => M[Y]): M[Y] = f(m.x)
^
error: type mismatch:
found : Test.this.Left[Nothing', Nothing']
required: Nothing'{_$hk$0 = Nothing'}
println(flatMap(Left(1), {x: Int => Left(x)}))
^
error: type mismatch:
found : Test.this.Left[Nothing', Nothing']
required: Nothing'{_$hk$0 = Y?}
println(flatMap(Left(1), {x: Int => Left(x)}))
^
three errors found
Similar, with M not upper bounded and flatMap not implemented:
error: type mismatch:
found : Test.this.Left[Nothing', Nothing']
required: Nothing'{_$hk$0 = Nothing'}
println(flatMap(Left(1), {x: Int => Left(x)}))
^
found : Test.this.Left[Nothing', Nothing']
required: Nothing'{_$hk$0 = Y?}
println(flatMap(Left(1), {x: Int => Left(x)}))
^
two errors found
This one actually works in Dotty with final val flagDeepSubTypeRecursions = false in Config (if true, the assertion in TypeComparer.monitoredSubtype fails.
This compiles without error:
The next trait compiles with an error (which feels inadequate and the source location is lost during reporting):
The next trait compiles with the same error (though I guess it is by design here and the source location is preserved):
All these traits compile fine with Scala 2.10.3.
The text was updated successfully, but these errors were encountered: