We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In #2450 we introduced
@freestanding(expression) public macro checkGeneric_root<DAS>() = #externalMacro(module: "MacroDefinition", type: "GenericToVoidMacro") @freestanding(expression) public macro checkGeneric<DAS>() = #checkGeneric_root<DAS>()
such that the DAS gets replaced in every expansion:
checkGeneric<String> -> checkGeneric_root<String>
but the following cases are not replaced yet:
Would it make sense to specialize macros with types that aren’t part of the second-level macro? Ie. would the following make sense?
macro gen<T>(a: T) = #externalMacro … macro genString(a: String) = #gen<String>(a: a)
And then #genString(a: "x") would have the intermediate expansion step #gen(a: "x")
Similarly, would it make sense to allow generic nesting in a second-level macro definition? Ie. would something like the following make sense?
macro gen<T>(a: T) = #externalMacro … macro genArray<T>(a: [T]) = #gen<Array<T>>(a: a)
And then #genArray(a: [1]) would have the intermediate expansion step #gen<Array>(a: [1])
#2450 (comment)
No response
rdar://122364628
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
In #2450 we introduced
such that the DAS gets replaced in every expansion:
but the following cases are not replaced yet:
Would it make sense to specialize macros with types that aren’t part of the second-level macro? Ie. would the following make sense?
And then #genString(a: "x") would have the intermediate expansion step #gen(a: "x")
Similarly, would it make sense to allow generic nesting in a second-level macro definition? Ie. would something like the following make sense?
And then #genArray(a: [1]) would have the intermediate expansion step #gen<Array>(a: [1])
#2450 (comment)
Steps to Reproduce
No response
Radar
rdar://122364628
The text was updated successfully, but these errors were encountered: