diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 32578ed5c026a..6280f74bc35e1 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -3952,8 +3952,8 @@ ERROR(attr_incompatible_with_objc,none, (DeclAttribute, DescriptiveDeclKind)) ERROR(final_not_on_accessors,none, - "'final' cannot be applied to accessors, it must be put on the " - "%select{var|let|subscript}0", (unsigned)) + "only the %select{property|subscript}0 itself can be marked as 'final'" + ,(bool)) ERROR(override_rethrows_with_non_rethrows,none, "override of 'rethrows' %select{method|initializer}0 should also " @@ -4985,8 +4985,8 @@ NOTE(candidate_is_not_assignable,none, (const ValueDecl *)) NOTE(change_to_mutating,none, - "mark %select{method|accessor}0 'mutating' to make 'self' mutable", - (bool)) + "mark %select{method|%1}0 'mutating' to make 'self' mutable", + (bool, StringRef)) NOTE(masked_mutable_property,none, "add explicit '%0' to refer to mutable %1 of %2", (StringRef, DescriptiveDeclKind, Type)) @@ -5344,7 +5344,7 @@ NOTE(note_add_distributed_to_decl,none, ERROR(invalid_isolated_calls_in_body,none, "calls to '@%0'-isolated' code in %kind1", (StringRef, const ValueDecl *)) -NOTE(add_globalactor_to_function,none, +NOTE(add_globalactor_to_decl,none, "add '@%0' to make %kind1 part of global actor %2", (StringRef, const ValueDecl *, Type)) FIXIT(insert_globalactor_attr, "@%0 ", (Type)) @@ -5579,8 +5579,6 @@ ERROR(shared_immutable_state_decl,none, NOTE(shared_state_make_immutable,none, "convert %0 to a 'let' constant to make 'Sendable' shared state immutable", (const ValueDecl *)) -NOTE(shared_state_main_actor_node,none, - "annotate %0 with '@MainActor' if property should only be accessed from the main actor", (const ValueDecl *)) NOTE(shared_state_nonisolated_unsafe,none, "disable concurrency-safety checks if accesses are protected by an external synchronization mechanism", (const ValueDecl *)) ERROR(actor_isolated_witness,none, @@ -6314,9 +6312,8 @@ NOTE(objc_witness_objc_requirement,none, ERROR(no_opaque_return_type_of,none, "unable to resolve type for _opaqueReturnTypeOf attribute", ()) - ERROR(objc_observing_accessor, none, - "observing accessors are not allowed to be marked @objc", ()) + "observers (%0) are not allowed to be marked '@objc'", (DescriptiveDeclKind)) ERROR(objc_init_accessor, none, "init accessors cannot be marked @objc", ()) ERROR(objc_addressor, none, @@ -7133,8 +7130,8 @@ ERROR(property_wrapper_computed, none, "property wrapper cannot be applied to a computed property", ()) ERROR(property_wrapper_effectful,none, - "property wrappers currently cannot define an 'async' or 'throws' accessor", - ()) + "property wrapper's 'wrappedValue' property cannot define an 'async' or 'throws' %0", + (DescriptiveDeclKind)) ERROR(property_with_wrapper_conflict_attribute,none, "property %0 with a wrapper cannot also be " @@ -7546,7 +7543,7 @@ ERROR(invalid_decl_in_macro_expansion,none, "macro expansion cannot introduce %0", (DescriptiveDeclKind)) ERROR(let_accessor_expansion,none, - "cannot expand accessors on variable declared with 'let'", + "cannot expand accessor macro on variable declared with 'let'", ()) ERROR(invalid_main_type_in_macro_expansion,none, "macro expansion cannot introduce '@main' type", diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 225ea7cff1cb6..d19da0c0a11ee 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -8357,8 +8357,9 @@ void VarDecl::emitLetToVarNoteIfSimple(DeclContext *UseDC) const { } auto &d = getASTContext().Diags; + auto descriptiveKindName = Decl::getDescriptiveKindName(FD->getDescriptiveKind()); auto diags = d.diagnose(FD->getFuncLoc(), diag::change_to_mutating, - isa(FD)); + isa(FD), descriptiveKindName); if (auto nonmutatingAttr = FD->getAttrs().getAttribute()) { diags.fixItReplace(nonmutatingAttr->getLocation(), "mutating"); diff --git a/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift b/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift index 246a875f8d680..9b1853fc50569 100644 --- a/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift +++ b/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift @@ -12,7 +12,6 @@ import SwiftSyntax import SwiftSyntaxMacros import SwiftDiagnostics -import SwiftOperators import SwiftSyntaxBuilder public struct ObservableMacro { diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index 85a3e27475abe..8bdf22c44f978 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -1377,8 +1377,13 @@ void AttributeChecker::visitObjCAttr(ObjCAttr *attr) { if (!checkObjCDeclContext(D)) error = diag::invalid_objc_decl_context; else if (auto accessor = dyn_cast(func)) - if (!accessor->isGetterOrSetter()) - error = diag::objc_observing_accessor; + if (!accessor->isGetterOrSetter()) { + auto declKind = accessor->getDescriptiveKind(); + diagnoseAndRemoveAttr(attr, diag::objc_observing_accessor, declKind) + .limitBehavior(behavior); + reason.describe(D); + return; + } } else if (isa(D) || isa(D) || isa(D) || @@ -2535,10 +2540,8 @@ void AttributeChecker::visitFinalAttr(FinalAttr *attr) { if (auto *accessor = dyn_cast(D)) { if (!attr->isImplicit()) { - unsigned Kind = 2; - if (auto *VD = dyn_cast(accessor->getStorage())) - Kind = VD->isLet() ? 1 : 0; - diagnose(attr->getLocation(), diag::final_not_on_accessors, Kind) + diagnose(attr->getLocation(), diag::final_not_on_accessors, + isa(accessor->getStorage())) .fixItRemove(attr->getRange()); return; } diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index 0bb5ed58c4bf7..8a63d6adf27ea 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -2439,7 +2439,7 @@ namespace { if (fn->getOverriddenDecl()) return false; - fn->diagnose(diag::add_globalactor_to_function, + fn->diagnose(diag::add_globalactor_to_decl, globalActor->getWithoutParens().getString(), fn, globalActor) .fixItInsert(fn->getAttributeInsertionLoc(false), @@ -5436,7 +5436,7 @@ ActorIsolation ActorIsolationRequest::evaluate( // Diagnose global state that is not either immutable plus Sendable or // isolated to a global actor. - auto checkGlobalIsolation = [var = dyn_cast(value)]( + auto checkGlobalIsolation = [var = dyn_cast(value), &ctx]( ActorIsolation isolation) { // Diagnose only declarations in the same module. // @@ -5480,10 +5480,14 @@ ActorIsolation ActorIsolationRequest::evaluate( } } - diagVar->diagnose(diag::shared_state_main_actor_node, - diagVar) - .fixItInsert(diagVar->getAttributeInsertionLoc(false), - "@MainActor "); + auto mainActor = ctx.getMainActorType(); + if (mainActor) { + diagVar->diagnose(diag::add_globalactor_to_decl, + mainActor->getWithoutParens().getString(), + diagVar, mainActor) + .fixItInsert(diagVar->getAttributeInsertionLoc(false), + diag::insert_globalactor_attr, mainActor); + } diagVar->diagnose(diag::shared_state_nonisolated_unsafe, diagVar) .fixItInsert(diagVar->getAttributeInsertionLoc(true), diff --git a/lib/Sema/TypeCheckDeclObjC.cpp b/lib/Sema/TypeCheckDeclObjC.cpp index ed768ab50f149..14def039b30e4 100644 --- a/lib/Sema/TypeCheckDeclObjC.cpp +++ b/lib/Sema/TypeCheckDeclObjC.cpp @@ -681,7 +681,8 @@ bool swift::isRepresentableInObjC( // willSet/didSet implementations are never exposed to objc, they are // always directly dispatched from the synthesized setter. diagnoseAndRemoveAttr(accessor, Reason.getAttr(), - diag::objc_observing_accessor) + diag::objc_observing_accessor, + accessor->getDescriptiveKind()) .limitBehavior(behavior); Reason.describe(accessor); return false; diff --git a/lib/Sema/TypeCheckPropertyWrapper.cpp b/lib/Sema/TypeCheckPropertyWrapper.cpp index 21c03784ada8f..a1047ca49f571 100644 --- a/lib/Sema/TypeCheckPropertyWrapper.cpp +++ b/lib/Sema/TypeCheckPropertyWrapper.cpp @@ -108,7 +108,7 @@ static VarDecl *findValueProperty(ASTContext &ctx, NominalTypeDecl *nominal, // The property may not have any effects right now. if (auto getter = var->getEffectfulGetAccessor()) { - getter->diagnose(diag::property_wrapper_effectful); + getter->diagnose(diag::property_wrapper_effectful, getter->getDescriptiveKind()); return nullptr; } diff --git a/test/Concurrency/Inputs/sendable_cycle_other.swift b/test/Concurrency/Inputs/sendable_cycle_other.swift index e71ead1f5b455..eddc24505f93a 100644 --- a/test/Concurrency/Inputs/sendable_cycle_other.swift +++ b/test/Concurrency/Inputs/sendable_cycle_other.swift @@ -1,5 +1,5 @@ struct Foo { static let member = Bar() // expected-complete-warning {{static property 'member' is not concurrency-safe because non-'Sendable' type 'Bar' may have shared mutable state; this is an error in the Swift 6 language mode}} - // expected-complete-note@-1 {{annotate 'member' with '@MainActor' if property should only be accessed from the main actor}} + // expected-complete-note@-1 {{add '@MainActor' to make static property 'member' part of global actor 'MainActor'}} // expected-complete-note@-2{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} } diff --git a/test/Concurrency/concurrency_warnings.swift b/test/Concurrency/concurrency_warnings.swift index 76873edf00f04..c9cc307fc77b4 100644 --- a/test/Concurrency/concurrency_warnings.swift +++ b/test/Concurrency/concurrency_warnings.swift @@ -13,7 +13,7 @@ class GlobalCounter { // expected-note{{class 'GlobalCounter' does not conform t let rs = GlobalCounter() // expected-warning {{let 'rs' is not concurrency-safe because non-'Sendable' type 'GlobalCounter' may have shared mutable state; this is an error in the Swift 6 language mode}} // expected-note@-1 {{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} -// expected-note@-2 {{annotate 'rs' with '@MainActor' if property should only be accessed from the main actor}} +// expected-note@-2 {{add '@MainActor' to make let 'rs' part of global actor 'MainActor'}} import GlobalVariables diff --git a/test/Concurrency/concurrent_value_checking.swift b/test/Concurrency/concurrent_value_checking.swift index 3cac1a91dba29..b42e7d030a936 100644 --- a/test/Concurrency/concurrent_value_checking.swift +++ b/test/Concurrency/concurrent_value_checking.swift @@ -296,7 +296,7 @@ typealias BadGenericCF = @Sendable () -> T? typealias GoodGenericCF = @Sendable () -> T? // okay var concurrentFuncVar: (@Sendable (NotConcurrent) -> Void)? = nil // expected-warning{{var 'concurrentFuncVar' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode}} -// expected-note@-1 {{annotate 'concurrentFuncVar' with '@MainActor' if property should only be accessed from the main actor}} +// expected-note@-1 {{add '@MainActor' to make var 'concurrentFuncVar' part of global actor 'MainActor'}} // expected-note@-2 {{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} // expected-note@-3 {{convert 'concurrentFuncVar' to a 'let' constant to make 'Sendable' shared state immutable}} diff --git a/test/Concurrency/flow_isolation.swift b/test/Concurrency/flow_isolation.swift index 2ba4791cbebd2..4641a80a51664 100644 --- a/test/Concurrency/flow_isolation.swift +++ b/test/Concurrency/flow_isolation.swift @@ -520,7 +520,7 @@ struct CardboardBox { @available(SwiftStdlib 5.1, *) var globalVar: EscapeArtist? // expected-warning {{var 'globalVar' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode}} -// expected-note@-1 {{annotate 'globalVar' with '@MainActor' if property should only be accessed from the main actor}} +// expected-note@-1 {{add '@MainActor' to make var 'globalVar' part of global actor 'MainActor'}} // expected-note@-2 {{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} // expected-note@-3 {{convert 'globalVar' to a 'let' constant to make 'Sendable' shared state immutable}} diff --git a/test/Concurrency/freestanding_top_level.swift b/test/Concurrency/freestanding_top_level.swift index 4b4e9c41411d1..6dc35cc510247 100644 --- a/test/Concurrency/freestanding_top_level.swift +++ b/test/Concurrency/freestanding_top_level.swift @@ -2,7 +2,7 @@ // RUN: %target-swift-frontend -concurrency-model=task-to-thread -typecheck -verify -verify-additional-prefix complete- -strict-concurrency=complete %s // expected-complete-warning@+4 {{var 'global' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode}} -// expected-complete-note@+3 {{annotate 'global' with '@MainActor' if property should only be accessed from the main actor}}{{1-1=@MainActor }} +// expected-complete-note@+3 {{add '@MainActor' to make var 'global' part of global actor 'MainActor'}}{{1-1=@MainActor }} // expected-complete-note@+2 {{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}}{{1-1=nonisolated(unsafe) }} // expected-complete-note@+1 {{convert 'global' to a 'let' constant to make 'Sendable' shared state immutable}}{{1-4=let}} var global = 10 diff --git a/test/Concurrency/global_variables.swift b/test/Concurrency/global_variables.swift index 025d7d3d59985..efa4ee7c5dd93 100644 --- a/test/Concurrency/global_variables.swift +++ b/test/Concurrency/global_variables.swift @@ -15,7 +15,7 @@ actor TestGlobalActor { var mutableIsolatedGlobal = 1 var mutableNonisolatedGlobal = 1 // expected-error{{var 'mutableNonisolatedGlobal' is not concurrency-safe because it is nonisolated global shared mutable state}} -// expected-note@-1{{annotate 'mutableNonisolatedGlobal' with '@MainActor' if property should only be accessed from the main actor}}{{1-1=@MainActor }} +// expected-note@-1{{add '@MainActor' to make var 'mutableNonisolatedGlobal' part of global actor 'MainActor'}}{{1-1=@MainActor }} // expected-note@-2{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}}{{1-1=nonisolated(unsafe) }} // expected-note@-3{{convert 'mutableNonisolatedGlobal' to a 'let' constant to make 'Sendable' shared state immutable}}{{1-4=let}} @@ -48,25 +48,25 @@ actor TestActor { struct TestStatics { static let immutableExplicitSendable = TestSendable() static let immutableNonsendable = TestNonsendable() // expected-error{{static property 'immutableNonsendable' is not concurrency-safe because non-'Sendable' type 'TestNonsendable' may have shared mutable state}} - // expected-note@-1 {{annotate 'immutableNonsendable' with '@MainActor' if property should only be accessed from the main actor}} + // expected-note@-1 {{add '@MainActor' to make static property 'immutableNonsendable' part of global actor 'MainActor'}} // expected-note@-2 {{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} static nonisolated(unsafe) let immutableNonisolatedUnsafe = TestNonsendable() static nonisolated let immutableNonisolated = TestNonsendable() // expected-error{{static property 'immutableNonisolated' is not concurrency-safe because non-'Sendable' type 'TestNonsendable' may have shared mutable state}} // expected-note@-1 {{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} // expected-error@-2 {{'nonisolated' can not be applied to variable with non-'Sendable' type 'TestNonsendable'}} - // expected-note@-3{{annotate 'immutableNonisolated' with '@MainActor' if property should only be accessed from the main actor}} + // expected-note@-3{{add '@MainActor' to make static property 'immutableNonisolated' part of global actor 'MainActor'}} static nonisolated(unsafe) let immutableNonisolatedUnsafeSendable = TestSendable() // expected-warning@-1 {{'nonisolated(unsafe)' is unnecessary for a constant with 'Sendable' type 'TestSendable', consider removing it}} {{10-30=}} static let immutableInferredSendable = 0 static var mutable = 0 // expected-error{{static property 'mutable' is not concurrency-safe because it is nonisolated global shared mutable state}} // expected-note@-1{{convert 'mutable' to a 'let' constant to make 'Sendable' shared state immutable}} // expected-note@-2{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} - // expected-note@-3{{annotate 'mutable' with '@MainActor' if property should only be accessed from the main actor}} + // expected-note@-3{{add '@MainActor' to make static property 'mutable' part of global actor 'MainActor'}} static var computedProperty: Int { 0 } // computed property that, though static, has no storage so is not a global @TestWrapper static var wrapped: Int // expected-error{{static property 'wrapped' is not concurrency-safe because it is nonisolated global shared mutable state}} // expected-note@-1{{convert 'wrapped' to a 'let' constant to make 'Sendable' shared state immutable}}{{23-26=let}} // expected-note@-2{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}}{{16-16=nonisolated(unsafe) }} - // expected-note@-3{{annotate 'wrapped' with '@MainActor' if property should only be accessed from the main actor}}{{3-3=@MainActor }} + // expected-note@-3{{add '@MainActor' to make static property 'wrapped' part of global actor 'MainActor'}}{{3-3=@MainActor }} } public actor TestPublicActor { diff --git a/test/Concurrency/predates_concurrency_import.swift b/test/Concurrency/predates_concurrency_import.swift index 0e53fee9703be..80dfc810fedb5 100644 --- a/test/Concurrency/predates_concurrency_import.swift +++ b/test/Concurrency/predates_concurrency_import.swift @@ -44,7 +44,7 @@ let nonStrictGlobal = NonStrictClass() // no warning let strictGlobal = StrictStruct() // expected-warning{{let 'strictGlobal' is not concurrency-safe because non-'Sendable' type 'StrictStruct' may have shared mutable state}} // expected-note@-1{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} -// expected-note@-2{{annotate 'strictGlobal' with '@MainActor' if property should only be accessed from the main actor}} +// expected-note@-2{{add '@MainActor' to make let 'strictGlobal' part of global actor 'MainActor'}} extension NonStrictClass { @Sendable func f() { } @@ -62,7 +62,7 @@ struct HasStatics { // expected-warning@-1{{'nonisolated' can not be applied to variable with non-'Sendable' type 'StrictStruct'}} // expected-warning@-2{{static property 'ss' is not concurrency-safe because non-'Sendable' type 'StrictStruct' may have shared mutable state}} // expected-note@-3{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} - // expected-note@-4{{annotate 'ss' with '@MainActor' if property should only be accessed from the main actor}} + // expected-note@-4{{add '@MainActor' to make static property 'ss' part of global actor 'MainActor'}} } extension NonStrictClass2: @retroactive MySendableProto { } diff --git a/test/Concurrency/predates_concurrency_import_swift6.swift b/test/Concurrency/predates_concurrency_import_swift6.swift index 412d482823e34..d112159f61cd4 100644 --- a/test/Concurrency/predates_concurrency_import_swift6.swift +++ b/test/Concurrency/predates_concurrency_import_swift6.swift @@ -18,7 +18,7 @@ func test(ss: StrictStruct, ns: NonStrictClass) { let nonStrictGlobal = NonStrictClass() let strictGlobal = StrictStruct() // expected-warning{{let 'strictGlobal' is not concurrency-safe because non-'Sendable' type 'StrictStruct' may have shared mutable state}} -// expected-note@-1{{annotate 'strictGlobal' with '@MainActor' if property should only be accessed from the main actor}} +// expected-note@-1{{add '@MainActor' to make let 'strictGlobal' part of global actor 'MainActor'}} // expected-note@-2{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}} extension NonStrictClass { diff --git a/test/Macros/accessor_macros.swift b/test/Macros/accessor_macros.swift index 01260850d249d..c277456f46afe 100644 --- a/test/Macros/accessor_macros.swift +++ b/test/Macros/accessor_macros.swift @@ -171,6 +171,6 @@ macro addGetterMacro() = #if TEST_DIAGNOSTICS struct S { @addGetterMacro let x: Int - // expected-warning@-1 {{cannot expand accessors on variable declared with 'let'; this is an error in the Swift 6 language mode}} + // expected-warning@-1 {{cannot expand accessor macro on variable declared with 'let'; this is an error in the Swift 6 language mode}} } #endif diff --git a/test/Sema/immutability.swift b/test/Sema/immutability.swift index 7669a9275b74d..3c7ba34f9954f 100644 --- a/test/Sema/immutability.swift +++ b/test/Sema/immutability.swift @@ -149,7 +149,7 @@ struct SomeStruct { var p: Int { // Getters default to non-mutating. - get { // expected-note {{mark accessor 'mutating' to make 'self' mutable}} {{5-5=mutating }} + get { // expected-note {{mark getter 'mutating' to make 'self' mutable}} {{5-5=mutating }} iv = 37 // expected-error {{cannot assign to property: 'self' is immutable}} return 42 } @@ -168,13 +168,13 @@ struct SomeStruct { return 42 } nonmutating - set { // expected-note {{mark accessor 'mutating' to make 'self' mutable}} {{-1:5-16=mutating}} + set { // expected-note {{mark setter 'mutating' to make 'self' mutable}} {{-1:5-16=mutating}} iv = newValue // expected-error {{cannot assign to property: 'self' is immutable}} } } var r : Int { - get { // expected-note {{mark accessor 'mutating' to make 'self' mutable}} {{5-5=mutating }} + get { // expected-note {{mark getter 'mutating' to make 'self' mutable}} {{5-5=mutating }} iv = 37 // expected-error {{cannot assign to property: 'self' is immutable}} return 42 } @@ -708,7 +708,7 @@ extension JustAProtocol { var foo: String { get { return name } nonmutating set { name = newValue } // expected-error {{cannot assign to property: 'self' is immutable}} - // expected-note@-1 {{mark accessor 'mutating' to make 'self' mutable}}{{5-16=mutating}} + // expected-note@-1 {{mark setter 'mutating' to make 'self' mutable}}{{5-16=mutating}} } nonmutating func bar() { // expected-note {{mark method 'mutating' to make 'self' mutable}}{{3-14=mutating}} diff --git a/test/attr/attr_objc.swift b/test/attr/attr_objc.swift index 553bf0edc84e9..1814e1b9e57b1 100644 --- a/test/attr/attr_objc.swift +++ b/test/attr/attr_objc.swift @@ -142,10 +142,10 @@ class subject_getterSetter1 { } var observingAccessorsVar1: Int = 0 { - @objc // expected-error {{observing accessors are not allowed to be marked @objc}} {{5-11=}} + @objc // expected-error {{observers (willSet observer) are not allowed to be marked '@objc'}} {{5-11=}} willSet { } - @objc // expected-error {{observing accessors are not allowed to be marked @objc}} {{5-11=}} + @objc // expected-error {{observers (didSet observer) are not allowed to be marked '@objc'}} {{5-11=}} didSet { } } @@ -2091,7 +2091,7 @@ class BadClass2 { } var prop3: Int { - @objc(setProperty:) // expected-error{{observing accessors are not allowed to be marked @objc}} {{5-25=}} + @objc(setProperty:) // expected-error{{observers (didSet observer) are not allowed to be marked '@objc'}} {{5-25=}} didSet { } } } diff --git a/test/decl/ext/extensions.swift b/test/decl/ext/extensions.swift index 8add229e264f4..8bce7505e9e17 100644 --- a/test/decl/ext/extensions.swift +++ b/test/decl/ext/extensions.swift @@ -200,13 +200,13 @@ extension DoesNotImposeClassReq_2 where Self : AnyObject { var wrappingProperty1: String { get { property } set { property = newValue } // expected-error {{cannot assign to property: 'self' is immutable}} - // expected-note@-1 {{mark accessor 'mutating' to make 'self' mutable}}{{5-5=mutating }} + // expected-note@-1 {{mark setter 'mutating' to make 'self' mutable}}{{5-5=mutating }} } var wrappingProperty2: String { get { property } nonmutating set { property = newValue } // expected-error {{cannot assign to property: 'self' is immutable}} - // expected-note@-1 {{mark accessor 'mutating' to make 'self' mutable}}{{5-16=mutating}} + // expected-note@-1 {{mark setter 'mutating' to make 'self' mutable}}{{5-16=mutating}} } var wrappingProperty3: String { diff --git a/test/decl/subscript/subscripting.swift b/test/decl/subscript/subscripting.swift index 2cf1de7fcaabd..178f62882c21a 100644 --- a/test/decl/subscript/subscripting.swift +++ b/test/decl/subscript/subscripting.swift @@ -320,7 +320,7 @@ struct MutableComputedGetter { struct MutableSubscriptInGetter { var value: Int subscript(index: Int) -> Int { - get { // expected-note {{mark accessor 'mutating' to make 'self' mutable}} + get { // expected-note {{mark getter 'mutating' to make 'self' mutable}} value = 5 // expected-error{{cannot assign to property: 'self' is immutable}} return 5 } diff --git a/test/decl/var/effectful_property_wrapper.swift b/test/decl/var/effectful_property_wrapper.swift index ae6ba8c6f4d2a..b2c3e693fec9d 100644 --- a/test/decl/var/effectful_property_wrapper.swift +++ b/test/decl/var/effectful_property_wrapper.swift @@ -10,7 +10,7 @@ struct Abstraction { init(_ initial : T) { self.value = initial } var wrappedValue : T { - get throws { return value } // expected-error{{property wrappers currently cannot define an 'async' or 'throws' accessor}} + get throws { return value } // expected-error{{property wrapper's 'wrappedValue' property cannot define an 'async' or 'throws' getter}} } // its OK to have effectful props that are not `wrappedValue` diff --git a/utils/update_checkout/update-checkout-config.json b/utils/update_checkout/update-checkout-config.json index 5ab347ee3e7da..bad25bfdda979 100644 --- a/utils/update_checkout/update-checkout-config.json +++ b/utils/update_checkout/update-checkout-config.json @@ -188,6 +188,8 @@ "swift-stress-tester": "release/6.0", "swift-corelibs-xctest": "release/6.0", "swift-corelibs-foundation": "release/6.0", + "swift-foundation": "main", + "swift-foundation-icu": "main", "swift-corelibs-libdispatch": "release/6.0", "swift-integration-tests": "release/6.0", "swift-xcode-playground-support": "release/6.0",