Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Handle match types reducing to ErrorType in TypeComparer #19961

Closed

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
1 participant