Polymorphism
Background
Section titled “Background”Given a file named “pen.json” with:
{ "type": "library", "dependencies": {}}Use an equal operator
Section titled “Use an equal operator”Given a file named “Foo.pen” with:
f = \(x number | none) boolean { x == none}When I run pen build
Then the exit status should be 0.
Use a not-equal operator
Section titled “Use a not-equal operator”Given a file named “Foo.pen” with:
f = \(x number | none) boolean { x != none}When I run pen build
Then the exit status should be 0.
Compare unions
Section titled “Compare unions”Given a file named “Foo.pen” with:
f = \(x number | none, y number | none) boolean { x == y}When I run pen build
Then the exit status should be 0.
Compare a union and none
Section titled “Compare a union and none”Given a file named “Foo.pen” with:
f = \(x number | none) boolean { x == none}When I run pen build
Then the exit status should be 0.