close
Skip to content

[Type checker] Don't infer 'dynamic' for 'let' variables or within final classes#4875

Merged
tkremenek merged 1 commit intoswiftlang:swift-3.0-branchfrom
DougGregor:sr-993-3_0
Sep 20, 2016
Merged

[Type checker] Don't infer 'dynamic' for 'let' variables or within final classes#4875
tkremenek merged 1 commit intoswiftlang:swift-3.0-branchfrom
DougGregor:sr-993-3_0

Conversation

@DougGregor
Copy link
Copy Markdown
Member

The 'dynamic' inference would infer 'dynamic' in places where it would
also infer 'final', leading to a diagnostic

error: a declaration cannot be both 'final' and 'dynamic'

with no source location information. Don't infer 'dynamic' in such
places.

Resolves SR-993 / rdar://problem/20449627

(cherry picked from commit 8166126)

…nal classes.

The 'dynamic' inference would infer 'dynamic' in places where it would
also infer 'final', leading to a diagnostic

  error: a declaration cannot be both 'final' and 'dynamic'

with no source location information. Don't infer 'dynamic' in such
places. Fixes SR-993 / rdar://problem/20449627.

(cherry picked from commit 8166126)
@DougGregor DougGregor added this to the Swift 3.0 milestone Sep 20, 2016
@DougGregor
Copy link
Copy Markdown
Member Author

@swift-ci please test

@DougGregor
Copy link
Copy Markdown
Member Author

@jrose-apple please review

@jrose-apple
Copy link
Copy Markdown
Contributor

jrose-apple commented Sep 20, 2016

Does this mean a static let in an extension can't be @objc? That seems wrong too, but if it is what we're doing it needs a PrintAsObjc test.

@DougGregor
Copy link
Copy Markdown
Member Author

A static let in an extension can by @objc, because it's okay to be @objc and final... just not final and dynamic.

@jrose-apple
Copy link
Copy Markdown
Contributor

Oh, wait, right. The dynamic is only because we want to let people override, and that's not relevant here.

@tkremenek tkremenek merged commit 6f4e9a9 into swiftlang:swift-3.0-branch Sep 20, 2016
@DougGregor DougGregor deleted the sr-993-3_0 branch September 20, 2016 17:18
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