-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label
Description
MatchTypeNoCases error defined at
scala3/compiler/src/dotty/tools/dotc/reporting/messages.scala
Lines 3311 to 3314 in f67a1a0
| class MatchTypeNoCases(casesText: String)(using Context) extends TypeMsg(MatchTypeNoCasesID): | |
| def msg(using Context) = i"Match type reduction $casesText" | |
| def explain(using Context) = "" | |
originally used in
scala3/compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Lines 3955 to 3963 in f67a1a0
| case Nil => | |
| /* TODO warn ? then re-enable warn/12974.scala:26 | |
| val noCasesText = MatchTypeTrace.noMatchesText(scrut, cases) | |
| report.warning(reporting.MatchTypeNoCases(noCasesText), pos = ???) | |
| */ | |
| MatchTypeTrace.noMatches(scrut, cases) | |
| NoType | |
| inFrozenConstraint(recur(cases)) |
is still commented out. It makes this error code effectively inactive.
The mentioned test is still commented out
Lines 22 to 34 in f67a1a0
| def main(args: Array[String]) = | |
| import Record._ | |
| val foo: Any = Rec.empty.fetch("foo") // TODO | |
| // ^ | |
| // Match type reduction failed since selector EmptyTuple.type | |
| // matches none of the cases | |
| // | |
| // case (("foo" : String), t) *: _ => t | |
| // case _ *: t => example.RecMap.Record.Rec.HasKey[t, ("foo" : String)] | |
| end main |
Compiler version
3.7.4
3.8.1-nightly
Expectation
It's been almost 2 years since this error message was suppressed we should either restore the original mechanism or make the error formally inactive.
Maybe related discussion in #23822
Metadata
Metadata
Assignees
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label