-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Print attributes on enum cases correctly (like 'indirect') #26311
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
Print attributes on enum cases correctly (like 'indirect') #26311
Conversation
@swift-ci Please test |
@swift-ci Please test source compatibility |
Thanks for adding the verifier check too. |
Build failed |
Previously they were just skipped if enum elements weren't exploded into their own individual lines, since the ASTPrinter assumed they'd be present on the EnumCaseDecl. This led to miscompiles when using a module interface for an enum with indirect cases, since they'd be printed as non-indirect cases. rdar://problem/53329452
d35ec61
to
f54c39b
Compare
Build failed |
Build failed |
indirect case b(Int) | ||
// CHECK-NEXT: {{^}} case c{{$}} | ||
case c | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's worth to add test cases for multi element case decl? e.g.
enum Something {
indirect case a(Int), b(Int)
case c
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm, good point. This is a time-sensitive fix so I'll do it in a follow-up.
…#26311) Previously they were just skipped if enum elements weren't exploded into their own individual lines, since the ASTPrinter assumed they'd be present on the EnumCaseDecl. This led to miscompiles when using a module interface for an enum with indirect cases, since they'd be printed as non-indirect cases. rdar://problem/53329452 (cherry picked from commit 3596df7)
Previously they were just skipped if enum elements weren't exploded into their own individual lines, since the ASTPrinter assumed they'd be present on the EnumCaseDecl. This led to miscompiles when using a module interface for an enum with indirect cases, since they'd be printed as non-indirect cases.
rdar://problem/53329452