pyret-lang icon indicating copy to clipboard operation
pyret-lang copied to clipboard

Certain invalid `forall`/type application combinations result in an unmatched cases in the type checker (4 fields)

Open molenzwiebel opened this issue 4 years ago • 1 comments

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

molenzwiebel avatar Jun 01 '21 18:06 molenzwiebel

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 .

jpolitz avatar Jun 01 '21 21:06 jpolitz