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
[SR-64] Allow generic parameters on typealiases #42686
Comments
This was already discussed on swift-evolution: https://lists.swift.org/pipermail/swift-evolution/2015-December/000132.html The consensus is this is an obviously desirable feature. |
Comment by Austin Zheng (JIRA) So, how would this work? If I hypothetically wanted to work on the task, would I assign it to myself? What if someone else wanted to work on it as well? Should there be discussion first? (Sorry, new to Jira in the context of open-source projects.) |
Good question. I've never used JIRA with open-source projects before, just GitHub Issues (where assigning is rare). My inclination is that if you want to work on something where you'll have a patch soon, or where if you don't have a patch soon you'll abandon it (e.g. you aren't sure if you have the requisite knowledge to fix it but you want to give it a shot), then you should just submit a patch. But if you're worried that someone else might start working on it at the same time and you don't want to duplicate effort, then certainly saying something is a good idea. Whether or not you should actually assign it to yourself is something that the core team probably has to decide. |
Comment by Austin Zheng (JIRA) Thanks for the insight. I'd like to take a shot at it, but I wouldn't want to stop anyone else who also wanted to try working on it. I guess this Jira comment thread is as good a place as any to discuss who'd be interested in working on what. |
++Kevin. The next step for the feature is getting a formal proposal through the Swift Language Process, but this bug report can be used to track implementation progress. I'd expect anyone to read the comments before assigning the bug to themselves, so not marking yourself as assignee while you're just toying around with it seems appropriate. |
Comment by Austin Zheng (JIRA) Right. Based on the discussion it seems like the exact implementation won't be straightforward, so nobody should be working on it until a proposal is approved anyways. |
Comment by Oliver Jones (JIRA) Just being able to typealias generic types to rename them would be a bonus. Eg, This is currently not possible: class Person<T> {}
typealias LaPersonne = Person Sometimes for clarity it is desirable to rename a type in a more specific local context and at the moment it doesn't appear to be possible to do with generic types without specialising those types. |
orj (JIRA User) The ideal way to handle that is to say typealias LaPersonne<T> = Person<T> If we didn't want to support generic parameters on typealiases then I'd say your |
This is implemented in Swift 3.0. |
Additional Detail from JIRA
md5: 1ffbbd3dbec72831eafe2d1921c680d6
Issue Description:
It would be really handy if typealiases could take generic parameters, e.g.
The text was updated successfully, but these errors were encountered: