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

Incorrect behaviour when resolving associated type of an interface #4918

Open
casper-pragma opened this issue Apr 27, 2022 · 0 comments
Open

Comments

@casper-pragma
Copy link

I have defined the following interface:

interface Failable c where
  Failure : Type
  initWithFailure : Failure -> c

Then I proceeded to create an implementation:

Failable (Maybe a) where
  Failure = ({T:Type} -> T)
  initWithFailure _ = Nothing

This was accepted by the compiler, but when I tried to use it in the following manner...

main :: IO ()
main = do
  let smth : ({K:Type} -> Maybe K) = initWithFailure ()

...the compiler said that there is a type mismatch between () and Failure.

This not suppose to happen, right?

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

No branches or pull requests

1 participant