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

type definition leads to odd errors #1677

Open
shriram opened this issue Dec 28, 2022 · 2 comments
Open

type definition leads to odd errors #1677

shriram opened this issue Dec 28, 2022 · 2 comments

Comments

@shriram
Copy link
Member

shriram commented Dec 28, 2022

Writing

type Key = String

in definitions runs fine. You can also write

s :: Key = "x"

in definitions and it's available in interactions. But writing

y :: Key = "x"

in interactions produces an internal error:

"Could not find type Key on module definitions://"

If you stick entirely to interactions, you can write both the type declaration and its uses in interactions.

But if you write the type declaration in definitions, run, and then enter it again in interactions, you don't get a duplicate definition error; instead, you again get the above "could not find" error.

@shriram
Copy link
Member Author

shriram commented Dec 28, 2022

@asolove
Copy link

asolove commented Jan 1, 2023

Interestingly, if you switch CPO from running untyped to running with types, then this works in the REPL fine:

Untyped (breaks):
image

Typed (works):
image

Perhaps we're throwing away some of the type info from the definitions window when running untyped?

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

2 participants