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: tests/allan/Test.scala:104:9-----------------------------------------104|casexs: Bar=>1|^|thiscase is unreachable since traitFunction0 and classBar are unrelated
However, this is not an issue with the exhaustivity checker. It fails Ycheck:
checking tests/allan/Test.scala after phase MegaPhase{pruneErasedDefs, vcInlineMethods, seqLiterals, intercepted, getters, elimByName, collectNullableFields, elimOuterSelect, augmentScala2Traits, resolveSuper, primitiveForwarders, functionXXLForwarders, arrayConstructors}
exception while typing casevalx1: (() =>Foo)(xs) = xs.apply() of classclass dotty.tools.dotc.ast.Trees$ValDef#777
exception while typing {
casevalx1: (() =>Foo)(xs) = xs.apply()
if x1.$isInstanceOf$[Bar] then
{
casevalx2:Bar= x1.asInstanceOf[Bar]
casevalxs:Bar= x2
1
}
else2
} of classclass dotty.tools.dotc.ast.Trees$Block#778
...
Exception in thread "main" java.lang.AssertionError: assertion failed: found: Foo
required: (() =>Foo)(xs)
The type we get for case val x1 after ElimByName ((() => Foo)(xs)) is clearly wrong. Should be Foo
The text was updated successfully, but these errors were encountered:
Is it normal that the type of the scrutinee xs (in PatternMatcher) is TermRef(NoPrefix, xs)/ xs.type? That doesn't look very useful. Or maybe it is — it'd be bad for xs definition but it's fine for a mention to it.
x1's is given by TermRef(NoPrefix, xs).widenExpr, which won't strip the ExprType, but either widenTermRefExpr or (more conservative) widenIfUnstable will manage.
However, this is not an issue with the exhaustivity checker. It fails
Ycheck
:The type we get for
case val x1
afterElimByName
((() => Foo)(xs)
) is clearly wrong. Should beFoo
The text was updated successfully, but these errors were encountered: