pyret-lang
pyret-lang copied to clipboard
Certain invalid `forall`/type application combinations result in an unmatched cases in the type checker (4 fields)
Simplest example I could find:
type Bool = Boolean
type Id<T> = T
type AlsoBool = Id<Bool>
# Matching a cases branch pattern errored.
a :: AlsoBool<Number> = 1
Running this with the type checker on results in "Matching a cases branch pattern errored.". Interestingly, if we manually substitute the type aliases it does result in a readable (albeit bit nonsensical) error.
# The type constraint Boolean<Number> was incompatible with the type constraint Number
a :: Boolean<Number> = 1
This is definitely a bug in the type-checker, which we can track down and fix. Thanks!
On Tue, Jun 01, 2021 at 11:39 AM, Thijs Molendijk @.***> wrote:
Simplest example I could find:
type Bool = Boolean type Id<T> = T type AlsoBool = Id<Bool>
Matching a cases branch pattern errored.
a :: AlsoBool<Number> = 1
Running this with the type checker on results in "Matching a cases branch pattern errored.". Interestingly, if we manually substitute the type aliases it does result in a readable (albeit bit nonsensical) error.
The type constraint Boolean<Number> was incompatible with the type constraint Number
a :: Boolean<Number> = 1
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brownplt/pyret-lang/issues/1593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5IU5YXUY7CYAHPPGWRYDTQUSOTANCNFSM455GIZQA .