Commit Graph

7 Commits

Author SHA1 Message Date
Anthony Latsis
2cd90bdd69 AST: Quote attributes more consistently in DiagnosticsSema.def 2025-04-22 18:23:36 +01:00
Doug Gregor
22c0995046 Allow non-@objc ‘dynamic’ in all language modes.
Non-‘@objc’ ‘dynamic’ has been allowed since Swift 5, but there’s no
reason to tie it to the language mode (Swift >= 5).

Fixes rdar://problem/50348013.
2019-05-21 13:40:04 -07:00
Jordan Rose
744b15783d Test that initializers inherit '@objc' from convenience inits (#23305)
This is weird behavior---there's no 'override' keyword here or
anything! But we rely on it when a convenience initializer written in
Objective-C dispatches to another convenience initializer. Changing
this /will/ break some Apple Objective-C classes that are meant to be
subclassed, unfortunately.
2019-03-15 11:06:47 -07:00
Jordan Rose
6290d9be60 Introduce DescriptiveDeclKind::Property (#18183)
...and collapse StaticVar/ClassVar and StaticLet/ClassLet into
StaticProperty/ClassProperty.

"var" and "let" aren't great nouns to use in diagnostics to begin with,
especially alongside semantic terms like "instance method". Focus on
the type vs. non-type aspect instead with "property", which better
matches how people talk about member vars (and lets) anyway.
2018-07-30 09:23:59 -07:00
Doug Gregor
5cf233ba20 [SE-0160] Swift 3: Downgrade error about non-ObjC @(IB|GK)Inspectable properties
@IBInspectable and @GKInspectable both work via the Objective-C
runtime. SE-0160 made them imply @objc, but doing so made it an error
to define an @IBInspectable or @GKInspectable property with a type
that could not be expressed in Objective-C. The attribute is useless,
but this broke Swift 3 code.

So, downgrade the error to a warning in Swift 3 compatibility mode,
with a Fix-It to remove the useless attribute. It remains an error in
Swift 4.

Fixes rdar://problem/31408971.
2017-04-13 23:08:03 -07:00
Doug Gregor
cbaeca2c81 [SE-0160] Require '@objc' on 'dynamic' members in Swift 4. 2017-03-31 21:22:16 -07:00
Doug Gregor
ebdfb40ebb [SE-0160] Allow one to enable/disable Swift 3 @objc inference rules.
Introduce flags `-enable-swift3-objc-inference` and
`-disable-swift3-objc-inference` to enable/disable the Swift 3 `@objc`
inference rules. Under `-swift-version 3`, default to the former;
under `-swift-version 4`, default to the latter. For testing purposes,
one can provide either flag in eiher language mode.
2017-03-31 21:22:16 -07:00