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
-- [E007] TypeMismatchError: tests/playground/example.scala:8:14-------------8|val_:M[1] ="c"|^^^|Found: ("c":String)
|Required:M[(1:Int)]
||Note: a matchtypecould not be fully reduced:
|| trying to reduce M[(1:Int)]
| failed since selector (0:Int)
| does not matchcase (1:Int) + (1:Int) => ("b":String)
| and cannot be shown to be disjoint from it either.
|Therefore, reduction cannot advance to the remaining case||case _ => ("c":String)
|-----------------------------------------------------------------------------|Explanation (enabled by `-explain`)
|---------------------------------------||Tree:"c"|I tried to show that
| ("c":String)
| conforms to
|M[(1:Int)]
| but none of the attempts shown below succeeded:
||==> ("c":String) <:M[(1:Int)]
|==> ("c":String) <: (0:Int) match { case (2:Int) => ("a":String) case (1:Int) + (1:Int) => ("b":String) caseAny=> ("c":String) } <: ("a":String) | ("b":String) | ("c":String)
|==>String<: (0:Int) match { case (2:Int) => ("a":String) case (1:Int) + (1:Int) => ("b":String) caseAny=> ("c":String) } <: ("a":String) | ("b":String) | ("c":String) =false||The tests were made under the empty constraint
-----------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered:
Fixes#20166
Alternatively placing the tryCompiletimeConstantFold in
`AppliedType#superType` also seems to fix the issue and not break
anything. But I'm not very sure about the spec here either way.
Compiler version
3.5.0-RC1
Minimized code
Output
The text was updated successfully, but these errors were encountered: