Skip to content

Instantly share code, notes, and snippets.

@cyanglee
Created April 14, 2018 15:47
Show Gist options
  • Save cyanglee/427e5f114011b76516a26f543c40b096 to your computer and use it in GitHub Desktop.
Save cyanglee/427e5f114011b76516a26f543c40b096 to your computer and use it in GitHub Desktop.
> bill = { name = "Gates", age = 57 }
{ name = "Gates", age = 57 } : { age : number, name : String }
> { bill | test = "123" }
-- TYPE MISMATCH --------------------------------------------- repl-temp-000.elm
`bill` is being used in an unexpected way.
4| { bill | test = "123" }
^^^^
Based on its definition, `bill` has this type:
{ age : ..., name : ... }
But you are trying to use it as:
{ b | test : ... }
Hint: The record fields do not match up. One has age and name. The other has
test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment