Skip to content

Commit 5e41794

Browse files
committed
AST: Quote attributes more consistently in DiagnosticsSema.def
1 parent ce9d5f5 commit 5e41794

File tree

147 files changed

+962
-942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+962
-942
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 157 additions & 137 deletions
Large diffs are not rendered by default.

test/ClangImporter/availability_macosx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func bezierPathElementToInteger(_ e: NSBezierPathElement) -> Int {
2929
}
3030

3131
func integerToBezierPathElement(_ i: Int) -> NSBezierPathElement {
32-
// expected-note@-1 2 {{add @available attribute to enclosing global function}}
32+
// expected-note@-1 2 {{add '@available' attribute to enclosing global function}}
3333
switch i {
3434
case 1:
3535
return .moveTo

test/ClangImporter/cf.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ func testNonConstVoid() {
161161

162162
class NuclearFridge: CCRefrigerator {} // expected-error {{cannot inherit from Core Foundation type 'CCRefrigerator'}}
163163
extension CCRefrigerator {
164-
@objc func foo() {} // expected-error {{method cannot be marked @objc because Core Foundation types are not classes in Objective-C}}
164+
@objc func foo() {} // expected-error {{method cannot be marked '@objc' because Core Foundation types are not classes in Objective-C}}
165165
func bar() {} // okay, implicitly non-objc
166166
}
167167

168168
protocol SwiftProto {}
169169
@objc protocol ObjCProto {}
170-
extension CCRefrigerator: ObjCProto {} // expected-error {{Core Foundation class 'CCRefrigerator' cannot conform to @objc protocol 'ObjCProto' because Core Foundation types are not classes in Objective-C}}
170+
extension CCRefrigerator: ObjCProto {} // expected-error {{Core Foundation class 'CCRefrigerator' cannot conform to '@objc' protocol 'ObjCProto' because Core Foundation types are not classes in Objective-C}}
171171
extension CCRefrigerator: SwiftProto {}

test/ClangImporter/enum-error.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func testError() {
118118

119119
#if ERRORS
120120
class ObjCTest {
121-
@objc func foo() -> TestError {} // expected-error {{method cannot be marked @objc because its result type cannot be represented in Objective-C}} expected-note {{Swift structs cannot be represented in Objective-C}}
121+
@objc func foo() -> TestError {} // expected-error {{method cannot be marked '@objc' because its result type cannot be represented in Objective-C}} expected-note {{Swift structs cannot be represented in Objective-C}}
122122
@objc func bar() -> TestError.Code {} // okay
123123
}
124124
#endif

test/ClangImporter/objc-cross-module-override.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import ImageInitializers
1212

1313
final class MyImage : Image {
14-
// CHECK: non-@objc initializer 'init(imageLiteralResourceName:)' is declared in extension of 'Image' and cannot be overridden
14+
// CHECK: non-'@objc' initializer 'init(imageLiteralResourceName:)' is declared in extension of 'Image' and cannot be overridden
1515
// Make sure we aren't emitting a fixit into the extant module...
1616
// CHECK-NOT: add '@objc' to make this declaration overridable
1717
// CHECK: ImageInitializers.Image.init:{{.*}}: note: overridden declaration is here

test/ClangImporter/objc_factory_method.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func testInstanceTypeFactoryMethodInherited() {
2828
}
2929

3030
func testFactoryWithLaterIntroducedInit() {
31-
// expected-note @-1 4{{add @available attribute to enclosing global function}}
31+
// expected-note @-1 4{{add '@available' attribute to enclosing global function}}
3232
// Prefer importing more available factory initializer over less
3333
// less available convenience initializer
3434
_ = NSHavingConvenienceFactoryAndLaterConvenienceInit(flim:5)

test/ClangImporter/objc_override.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ class SomeCellSub5 : SomeCell {
8484
}
8585

8686
class FailSub : FailBase {
87-
override init(value: Int) { try! super.init(value: value) } // expected-error {{overriding a throwing @objc initializer with a non-throwing initializer is not supported}}
88-
override class func processValue() {} // expected-error {{overriding a throwing @objc method with a non-throwing method is not supported}}
87+
override init(value: Int) { try! super.init(value: value) } // expected-error {{overriding a throwing '@objc' initializer with a non-throwing initializer is not supported}}
88+
override class func processValue() {} // expected-error {{overriding a throwing '@objc' method with a non-throwing method is not supported}}
8989
}
9090

9191
class CallbackSubA : CallbackBase {

test/ClangImporter/objc_parse.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,24 +648,24 @@ class NewtypeUser {
648648
@objc func stringNewtype(a: SNTErrorDomain) {} // expected-error {{'SNTErrorDomain' has been renamed to 'ErrorDomain'}}{{31-45=ErrorDomain}}
649649
@objc func stringNewtypeOptional(a: SNTErrorDomain?) {} // expected-error {{'SNTErrorDomain' has been renamed to 'ErrorDomain'}}{{39-53=ErrorDomain}}
650650
@objc func intNewtype(a: MyInt) {}
651-
@objc func intNewtypeOptional(a: MyInt?) {} // expected-error {{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
652-
@objc func intNewtypeArray(a: [MyInt]) {} // expected-error {{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
651+
@objc func intNewtypeOptional(a: MyInt?) {} // expected-error {{method cannot be marked '@objc' because the type of the parameter cannot be represented in Objective-C}}
652+
@objc func intNewtypeArray(a: [MyInt]) {} // expected-error {{method cannot be marked '@objc' because the type of the parameter cannot be represented in Objective-C}}
653653
// expected-note@-1 {{Swift structs cannot be represented in Objective-C}}
654-
@objc func intNewtypeDictionary(a: [MyInt: NSObject]) {} // expected-error {{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
654+
@objc func intNewtypeDictionary(a: [MyInt: NSObject]) {} // expected-error {{method cannot be marked '@objc' because the type of the parameter cannot be represented in Objective-C}}
655655
// expected-note@-1 {{Swift structs cannot be represented in Objective-C}}
656656
@objc func cfNewtype(a: CFNewType) {}
657-
@objc func cfNewtypeArray(a: [CFNewType]) {} // expected-error {{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
657+
@objc func cfNewtypeArray(a: [CFNewType]) {} // expected-error {{method cannot be marked '@objc' because the type of the parameter cannot be represented in Objective-C}}
658658
// expected-note@-1 {{Swift structs cannot be represented in Objective-C}}
659659

660660
typealias MyTuple = (Int, AnyObject?)
661661
typealias MyNamedTuple = (a: Int, b: AnyObject?)
662662

663663
@objc func blockWithTypealias(_ input: @escaping (MyTuple) -> MyInt) {}
664-
// expected-error@-1{{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
664+
// expected-error@-1{{method cannot be marked '@objc' because the type of the parameter cannot be represented in Objective-C}}
665665
// expected-note@-2{{function types cannot be represented in Objective-C}}
666666

667667
@objc func blockWithTypealiasWithNames(_ input: (MyNamedTuple) -> MyInt) {}
668-
// expected-error@-1{{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
668+
// expected-error@-1{{method cannot be marked '@objc' because the type of the parameter cannot be represented in Objective-C}}
669669
// expected-note@-2{{function types cannot be represented in Objective-C}}
670670
}
671671

test/ClangImporter/objc_runtime_visible.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import ObjCRuntimeVisible
44

55
extension A {
6-
@objc func foo() { } // expected-error{{instance method cannot be marked @objc because class 'A' is only visible via the Objective-C runtime}}
6+
@objc func foo() { } // expected-error{{instance method cannot be marked '@objc' because class 'A' is only visible via the Objective-C runtime}}
77
func bar() {} // okay, implicitly non-objc
88
}
99

@@ -16,5 +16,5 @@ class B : A { } // expected-error{{cannot inherit from class 'A' because it is o
1616
protocol SwiftProto {}
1717
@objc protocol ObjCProto {}
1818

19-
extension A: ObjCProto {} // expected-error {{class 'A' cannot conform to @objc protocol 'ObjCProto' because the class is only visible via the Objective-C runtime}}
19+
extension A: ObjCProto {} // expected-error {{class 'A' cannot conform to '@objc' protocol 'ObjCProto' because the class is only visible via the Objective-C runtime}}
2020
extension A: SwiftProto {} // okay

test/Concurrency/actor_isolation_objc.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ actor A {
3636
var x: Int = 0 // expected-note{{add '@objc' to expose this property to Objective-C}}
3737

3838
@objc var y: Int = 0 // expected-note{{add '@objc' to expose this property to Objective-C}}
39-
// expected-error@-1{{actor-isolated property 'y' cannot be @objc}}
39+
// expected-error@-1{{actor-isolated property 'y' cannot be '@objc'}}
4040

4141
// expected-note@+1 {{add '@objc' to expose this property to Objective-C}}
42-
@objc var computed : Int { // expected-error{{actor-isolated property 'computed' cannot be @objc}}
42+
@objc var computed : Int { // expected-error{{actor-isolated property 'computed' cannot be '@objc'}}
4343
get { 120 }
4444
}
4545

@@ -50,7 +50,7 @@ actor A {
5050

5151
actor Dril: NSObject {
5252
// expected-note@+2 {{add 'async' to function 'postSynchronouslyTo(twitter:)' to make it asynchronous}}
53-
// expected-error@+1 {{actor-isolated instance method 'postSynchronouslyTo(twitter:)' cannot be @objc}}
53+
// expected-error@+1 {{actor-isolated instance method 'postSynchronouslyTo(twitter:)' cannot be '@objc'}}
5454
@objc func postSynchronouslyTo(twitter msg: String) -> Bool {
5555
return true
5656
}

0 commit comments

Comments
 (0)