Skip to content

Bug: union causes type confusion #59

Closed
@maurges

Description

@maurges

Using "purescript": "^0.13.6" and package set psc-0.13.6-20200423

Here's my foot gun:

main :: Effect Unit
main = do
    Console.log "1"
    let x = union {y: 5} {y: "5"}
    Console.log "2"
    let s = show x
    Console.log "3"
    Console.log s

Causes TypeError: s.replace is not a function after logging 2.

Changing to let x = union {y: "5"} {y: 5} gets rid of error and produces expected representation: { y: "5", y: 5 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions