Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

document well-typedness of object subtypes #116

Merged
merged 3 commits into from
Feb 24, 2012
Merged

document well-typedness of object subtypes #116

merged 3 commits into from
Feb 24, 2012

Conversation

gregwebs
Copy link
Collaborator

Please link to the docs - they are sorely needed!

@taku0
Copy link
Collaborator

taku0 commented Feb 24, 2012

The subtyping of objects seems very restricted.

The following code is typed:

let f x = x.y.z

f {x: 1, y: {z:1, zz: 2}}

while the following is not:

let f x = x.y.z

let g h = h {x: 1, y: {z:1, zz: 2}}

g f

The following is also typed.

let f x = x.y.z

let g h = h {y: {z:1}}

g f

@taku0
Copy link
Collaborator

taku0 commented Feb 24, 2012

Typed X(.

let f x = x.y.z

let g h = h {}

g f

@puffnfresh
Copy link
Owner

@taku0 that's probably because I haven't implemented structural types using type constraints. Lazy/silly/short-sighted of me.

Fixing that is on my TODO list :)

puffnfresh added a commit that referenced this pull request Feb 24, 2012
Document well-typedness of object subtypes, strings and RegExps
@puffnfresh puffnfresh merged commit fd6b991 into puffnfresh:master Feb 24, 2012
@puffnfresh
Copy link
Owner

@gregwebs absolutely awesome job. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants