Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify function subtyping #28

Closed
jclark opened this issue Mar 24, 2019 · 2 comments
Closed

Specify function subtyping #28

jclark opened this issue Mar 24, 2019 · 2 comments
Labels
design/incomplete Part of design not yet worked out lang Relates to the Ballerina language specification
Milestone

Comments

@jclark
Copy link
Collaborator

jclark commented Mar 24, 2019

The spec does not specify exactly how function subtyping should work.

Basic principle is that functions should be covariant in return type and contravariant in parameter types. Default values should not affect subtyping.

Ideally we want to define this in terms of shapes (ie type denotes set of shapes, and subtype means subset of denoted set of shapes).

Relates to #27

@jclark jclark added lang Relates to the Ballerina language specification design/incomplete Part of design not yet worked out labels Mar 24, 2019
@jclark jclark added this to the 2019R2 milestone Mar 24, 2019
@jclark jclark modified the milestones: 2019R2, 2019R1 Mar 28, 2019
jclark added a commit that referenced this issue Apr 1, 2019
@jclark
Copy link
Collaborator Author

jclark commented Apr 1, 2019

Mostly done now. Remains to define it in terms of shapes.

@jclark jclark closed this as completed in d7e91a8 Apr 28, 2019
@jclark jclark reopened this Apr 28, 2019
@jclark
Copy link
Collaborator Author

jclark commented Apr 29, 2019

I have separated the shape aspect into a separate issue #86.

@jclark jclark closed this as completed Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design/incomplete Part of design not yet worked out lang Relates to the Ballerina language specification
Projects
None yet
Development

No branches or pull requests

1 participant