Skip to content

Conversation

@theblixguy
Copy link
Collaborator

We don't support use of magic literals like #file or #line as raw values for an enum case. At the moment, the compiler simply crashes when it comes across such literals. I think we can support them but that involves a bit more work so for now let's just diagnose them as unsupported instead of crashing the compiler.

Resolves SR-12998

@theblixguy theblixguy requested a review from CodaFi June 13, 2020 18:09
@theblixguy
Copy link
Collaborator Author

@swift-ci please smoke test

Copy link
Contributor

@CodaFi CodaFi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take this over a crash, but could you test more kinds of literals?

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@theblixguy
Copy link
Collaborator Author

I have added a few more test cases (including a test for object literals). Should I cherry-pick this to 5.3 too?

@swift-ci please test

@CodaFi
Copy link
Contributor

CodaFi commented Jun 15, 2020

Thanks for the tests. I don't think this needs to go into 5.3.

@swift-ci please smoke test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants