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

Implement function subtyping #1677

Closed
Chriscbr opened this issue Feb 27, 2023 · 2 comments · Fixed by #1755
Closed

Implement function subtyping #1677

Chriscbr opened this issue Feb 27, 2023 · 2 comments · Fixed by #1755
Assignees
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler

Comments

@Chriscbr
Copy link
Contributor

Examples of function subtyping in action:

  • any function that accepts a parameter of type T can be assigned to a variable typed as a function that accepts a parameter of type U as long as T is a subtype of U
  • any function that returns type T can assigned to variable typed as a function that returns type U as long as U is a subtype of T
  • any function that is phase-independent can be assigned to a variable typed as an inflight function as long as the rest of the signatures match
  • any function that is phase-independent can be assigned to a variable typed as a preflight function as long as the rest of the signatures match

The subtyping logic is currently located here:

(Self::Function(l0), Self::Function(r0)) => l0 == r0,

@Chriscbr Chriscbr added 🐛 bug Something isn't working 🛠️ compiler Compiler labels Feb 27, 2023
@Chriscbr Chriscbr changed the title Implement proper function subtyping Implement function subtyping Feb 27, 2023
@monadabot monadabot added this to Wing Feb 27, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Feb 27, 2023
@staycoolcall911 staycoolcall911 moved this from 🆕 New - not properly defined to 🤝 Backlog - handoff to owners in Wing Mar 1, 2023
@Chriscbr
Copy link
Contributor Author

Chriscbr commented Mar 6, 2023

Depends on #1678

@staycoolcall911 staycoolcall911 moved this from 🤝 Backlog - handoff to owners to 🏗 In progress in Wing Mar 13, 2023
@mergify mergify bot closed this as completed in #1755 Mar 13, 2023
@mergify mergify bot closed this as completed in 4802ed9 Mar 13, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Wing Mar 13, 2023
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.5.125.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants