Closed meg-gupta closed 1 month ago
Please test with following pull request: https://github.com/apple/swift/pull/74195 @swift-ci test
@ahoppen We represent self
separately from identifier
as well - https://github.com/apple/swift-syntax/blob/1f220251532b12bdff8e574c012a9aea5b85b38d/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift#L520
I thought we want to represent nodes in the swift-syntax
AST separately when possible so that this information can be reconstructed if needed later.
We only needed to represent self
specifically because it’s an unconditional keyword. But immortal
isn’t a special keyword, so that’s fine.
I do have a question on the language design though. If I have
func foo(immortal: Int) -> dependsOn(immortal) X
Does this mean that the result depend on the parameter named immortal
or is it this custom syntax? If it is your new syntax, how can I make the result depend on the immortal
parameter?
Does this mean that the result depend on the parameter named
immortal
or is it this custom syntax? If it is your new syntax, how can I make the result depend on theimmortal
parameter?
That needs to be a syntax error: conflict between the parameter name and keyword. We should point that out in the proposal.
@ahoppen I'll close this PR and raise error for the scenario you brought up in Sema.
Used in cases where a nonescapable value must be constructed without any owner that can stand in as the source of a dependence. See https://gist.github.com/atrick/9ed708431e9a18059c22d37d18759c6d for details
Fixes rdar://129183196