Skip to content

Conversation

@theblixguy
Copy link
Collaborator

@theblixguy theblixguy commented May 20, 2020

At the moment, some redeclaration errors involving synthesised declarations can cause compiler crashes. For example:

@propertyWrapper 
struct Wrapper {
  var wrappedValue: Int
}

struct S {
  @Wrapper var foo1 = 123
  var _foo1 = 123
}

This currently crashes in the AST verifier on master and in SILGen on 5.3. Upon investigation, this seems to be a regression caused by #31037.

To fix the problem, I have added a specialised diagnostic for situations where the current declaration is synthesised. This also fixes a problem where the redeclaration diagnostics did not have a valid source location.

Resolves SR-12839
Resolves rdar://problem/63496795

@theblixguy theblixguy requested a review from CodaFi May 20, 2020 15:32
@xedin xedin requested a review from hborla May 20, 2020 17:53
@theblixguy
Copy link
Collaborator Author

@swift-ci please smoke test

@theblixguy
Copy link
Collaborator Author

@swift-ci please smoke test

Copy link
Member

@hborla hborla left a comment

Choose a reason for hiding this comment

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

Looks great, thank you @theblixguy !

@theblixguy
Copy link
Collaborator Author

@hborla Do you know if this can be cherry-picked to 5.3? I'd like to do that so we can fix the crash, alternatively we can revert #31037 on the 5.3 branch only (but that means we don't get the improved diagnostics).

@hborla
Copy link
Member

hborla commented May 21, 2020

@theblixguy yes, please prepare a PR for the 5.3 branch. Thank you!

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.

3 participants