Skip to content

Spelling attr #42552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/attr/attr_backDeploy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public func trailingWildcardFunc() {}
public func embeddedWildcardFunc() {}

@_backDeploy(before: _myProject 3.0) // expected-error {{reference to undefined version '3.0' for availability macro '_myProject'}}
public func macroVersionned() {}
public func macroVersioned() {}

@_backDeploy(before: _myProject) // expected-error {{reference to undefined version '0' for availability macro '_myProject'}}
public func missingMacroVersion() {}
Expand All @@ -295,11 +295,11 @@ public func unknownMacroMissingVersion() {}

@_backDeploy(before: _unknownMacro 1.0) // expected-warning {{unknown platform '_unknownMacro' for attribute '@_backDeploy'}}
// expected-error@-1 {{expected at least one platform version in '@_backDeploy' attribute}}
public func unknownMacroVersionned() {}
public func unknownMacroVersioned() {}

@available(macOS 11.0, *)
@_backDeploy(before: _unknownMacro 1.0, _myProject 2.0) // expected-warning {{unknown platform '_unknownMacro' for attribute '@_backDeploy'}}
public func knownAndUnknownMacroVersionned() {}
public func knownAndUnknownMacroVersioned() {}

@_backDeploy() // expected-error {{expected 'before:' in '@_backDeploy' attribute}}
// expected-error@-1 {{expected at least one platform version in '@_backDeploy' attribute}}
Expand Down
6 changes: 3 additions & 3 deletions test/attr/attr_backDeploy_evolution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// RUN: %empty-directory(%t/SDK_ABI)
// RUN: %empty-directory(%t/SDK_BD)

// ---- (1) Build famework with BackDeploy 2.0 in the past
// ---- (1) Build framework with BackDeploy 2.0 in the past
// RUN: mkdir -p %t/SDK_ABI/Frameworks/BackDeployHelper.framework/Modules/BackDeployHelper.swiftmodule
// RUN: %target-build-swift-dylib(%t/SDK_ABI/Frameworks/BackDeployHelper.framework/BackDeployHelper) \
// RUN: -emit-module-path %t/SDK_ABI/Frameworks/BackDeployHelper.framework/Modules/BackDeployHelper.swiftmodule/%module-target-triple.swiftmodule \
Expand All @@ -64,7 +64,7 @@
// RUN: %target-codesign %t/test_ABI
// RUN: %target-run %t/test_ABI %t/SDK_ABI/Frameworks/BackDeployHelper.framework/BackDeployHelper | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-ABI %s

// ---- (4) Build famework with BackDeploy 2.0 in the future
// ---- (4) Build framework with BackDeploy 2.0 in the future
// RUN: mkdir -p %t/SDK_BD/Frameworks/BackDeployHelper.framework/Modules/BackDeployHelper.swiftmodule
// RUN: %target-build-swift-dylib(%t/SDK_BD/Frameworks/BackDeployHelper.framework/BackDeployHelper) \
// RUN: -emit-module-path %t/SDK_BD/Frameworks/BackDeployHelper.framework/Modules/BackDeployHelper.swiftmodule/%module-target-triple.swiftmodule \
Expand All @@ -91,7 +91,7 @@
// RUN: %target-codesign %t/test_BD
// RUN: %target-run %t/test_BD %t/SDK_BD/Frameworks/BackDeployHelper.framework/BackDeployHelper | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-BD %s

// ---- (7) Re-build famework with the back deployed APIs stripped
// ---- (7) Re-build framework with the back deployed APIs stripped
// RUN: mkdir -p %t/SDK_BD/Frameworks/BackDeployHelper.framework/Modules/BackDeployHelper.swiftmodule
// RUN: %target-build-swift-dylib(%t/SDK_BD/Frameworks/BackDeployHelper.framework/BackDeployHelper) \
// RUN: -emit-module-path %t/SDK_BD/Frameworks/BackDeployHelper.framework/Modules/BackDeployHelper.swiftmodule/%module-target-triple.swiftmodule \
Expand Down
2 changes: 1 addition & 1 deletion test/attr/attr_dynamic_member_lookup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ func test_infinite_self_recursion() {
// expected-error@-1 {{value of type 'Recurse<Int>' has no dynamic member 'foo' using key path from root type 'Recurse<Int>'}}
}

// rdar://problem/60225883 - crash during solution application (ExprRewritter::buildKeyPathDynamicMemberIndexExpr)
// rdar://problem/60225883 - crash during solution application (ExprRewriter::buildKeyPathDynamicMemberIndexExpr)
func test_combination_of_keypath_and_string_lookups() {
@dynamicMemberLookup
struct Outer {
Expand Down
18 changes: 9 additions & 9 deletions test/attr/attr_objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ enum subject_enum: Int {
// Fake for access notes: @objc(subject_enumElement3) // bad-access-note-move@+2{{subject_enum.subject_enumElement4}}
@objc(subject_enumElement3) // bad-access-note-move{{subject_enum.subject_enumElement3}} expected-error {{'@objc' enum case declaration defines multiple enum cases with the same Objective-C name}}{{3-31=}}
case subject_enumElement3, subject_enumElement4
// Becuase of the fake access-note-move above, we expect to see extra diagnostics when we run this test with both explicit @objc attributes *and* access notes:
// Because of the fake access-note-move above, we expect to see extra diagnostics when we run this test with both explicit @objc attributes *and* access notes:
// expected-remark@-2 * {{'@objc' enum case declaration defines multiple enum cases with the same Objective-C name}} expected-note@-2 *{{attribute 'objc' was added by access note for fancy tests}}

// Fake for access notes: @objc // bad-access-note-move@+2{{subject_enum.subject_enumElement6}}
@objc // bad-access-note-move{{subject_enum.subject_enumElement5}} expected-error {{attribute has no effect; cases within an '@objc' enum are already exposed to Objective-C}} {{3-9=}}
case subject_enumElement5, subject_enumElement6
// Becuase of the fake access-note-move above, we expect to see extra diagnostics when we run this test with both explicit @objc attributes *and* access notes:
// Because of the fake access-note-move above, we expect to see extra diagnostics when we run this test with both explicit @objc attributes *and* access notes:
// expected-remark@-2 * {{attribute has no effect; cases within an '@objc' enum are already exposed to Objective-C}} expected-note@-2 *{{attribute 'objc' was added by access note for fancy tests}}

@nonobjc // expected-error {{'@nonobjc' attribute cannot be applied to this declaration}}
Expand Down Expand Up @@ -948,14 +948,14 @@ class infer_instanceVar1 {
// expected-note@-2 {{protocol-constrained type containing protocol 'PlainProtocol' cannot be represented in Objective-C}}
// Fake for access notes: @objc // access-note-move@-3{{infer_instanceVar1.instanceVar2_}}

var intstanceVar4: Int {
// CHECK: @objc var intstanceVar4: Int {
var instanceVar4: Int {
// CHECK: @objc var instanceVar4: Int {
get {}
// CHECK-NEXT: @objc get {}
}

var intstanceVar5: Int {
// CHECK: @objc var intstanceVar5: Int {
var instanceVar5: Int {
// CHECK: @objc var instanceVar5: Int {
get {}
// CHECK-NEXT: @objc get {}
set {}
Expand Down Expand Up @@ -1738,9 +1738,9 @@ protocol infer_instanceVar4 {
class infer_instanceVar5 {
// CHECK-LABEL: {{^}}class infer_instanceVar5 {

@objc // access-note-move{{infer_instanceVar5.intstanceVar1}}
var intstanceVar1: Int {
// CHECK: @objc var intstanceVar1: Int
@objc // access-note-move{{infer_instanceVar5.instanceVar1}}
var instanceVar1: Int {
// CHECK: @objc var instanceVar1: Int
get {}
// CHECK: @objc get {}
set {}
Expand Down
2 changes: 1 addition & 1 deletion test/attr/private_import.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

@_private(sourceFile: "Array.swift") import Swift // expected-error {{module 'Swift' was not compiled for private import}}
@_private(sourceFile: "empty.swift") import empty // no-error
@_private(sourceFile: "not_existing_file.swift") import empty // no-error
@_private(sourceFile: "nonexistent_file.swift") import empty // no-error

@_private(sourceFile: "none") func foo() {} // expected-error {{@_private may only be used on 'import' declarations}} {{1-31=}}