You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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:
This does not throw an error with
make
ormake -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):
The text was updated successfully, but these errors were encountered: