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 checker does not enforce that generic parameters are generic #1102

Open
edwardpeters opened this issue Sep 7, 2023 · 0 comments
Open
Labels
task Task level project item

Comments

@edwardpeters
Copy link

edwardpeters commented Sep 7, 2023

Describe the bug
If you declare a function as generic, but implement it in a way that only works for a single type, no error is given

To Reproduce
Compile the following code snippet:

typeErrorTest : t -> t
typeErrorTest x = if x then True else False

This does not throw an error with make or make -f.

Expected behavior
I would expect this code to throw an error, as you declared the function to use a generic type t, which cannot be inferred to be a specific type. (This is the behavior using Elm).

Desktop (please complete the following information):

  • OS: OSX
  • Browser: Unused
  • Version: 2.89.0
@edwardpeters edwardpeters added the task Task level project item label Sep 7, 2023
@edwardpeters edwardpeters changed the title Type checker does not enforce that generic paramters are generic Type checker does not enforce that generic parameters are generic Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Task level project item
Projects
None yet
Development

No branches or pull requests

1 participant