Skip to content

Conversation

EugeneFlesselle
Copy link
Contributor

Alternative to #19953, #19954

Fixes #19949
Fixes #19950

A match type has no matching cases is reduced to an `ErrorType` (different from throwing a TypeError), in distinction to the other cases for failed match type reduction which return `NoType`.

Producing to an ErrorType is usually accompanied by reporting an error, but does appear to be the case when attempting normalization from within the TypeComparer.
Prior to the changes contained, subtyping trace contained:
```
          <== isSubType <error The match type contains an illegal case:
    case AnyInt[a] => scala.compiletime.ops.int.S[a]
(this error can be ignored for now with `-source:3.3`)> <:< Nothing = true
        <== isSubType IndexOf[String,
  Tuple.Drop[(String, Int, String, Boolean),
    scala.compiletime.ops.int.S[IndexOf[String, (String, Int, String, Boolean)]]
    ]
] <:< Nothing = true
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in typelevel/spotted-leopards for extension methods Unsound conformance from selection of member MatchType

1 participant