Skip to content
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
3 changes: 0 additions & 3 deletions lib/Sema/TypeCheckAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4346,7 +4346,6 @@ static void checkGlobalActorAttr(
attributes[1])
.highlight(attributes[0]->getRangeWithAt())
.highlight(attributes[1]->getRangeWithAt())
.warnUntilSwiftVersion(6)
.fixItRemove(attributes[1]->getRangeWithAt());
return;
}
Expand All @@ -4357,7 +4356,6 @@ static void checkGlobalActorAttr(
.highlight(attributes[0]->getRangeWithAt())
.highlight(attributes[1]->getRangeWithAt())
.highlight(attributes[2]->getRangeWithAt())
.warnUntilSwiftVersion(6)
.fixItRemove(attributes[1]->getRangeWithAt())
.fixItRemove(attributes[2]->getRangeWithAt());
return;
Expand All @@ -4370,7 +4368,6 @@ static void checkGlobalActorAttr(
.highlight(attributes[1]->getRangeWithAt())
.highlight(attributes[2]->getRangeWithAt())
.highlight(attributes[3]->getRangeWithAt())
.warnUntilSwiftVersion(6)
.fixItRemove(attributes[1]->getRangeWithAt())
.fixItRemove(attributes[2]->getRangeWithAt())
.fixItRemove(attributes[3]->getRangeWithAt());
Expand Down
10 changes: 5 additions & 5 deletions test/Concurrency/isolated_parameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,15 @@ func isolatedClosures() {
}
}

// expected-warning@+3 {{global function 'allOfEm' has multiple actor-isolation attributes (@MainActor and 'nonisolated')}}
// expected-warning@+2 {{global function with 'isolated' parameter cannot be 'nonisolated'; this is an error in the Swift 6 language mode}}{{12-24=}}
// expected-warning@+1 {{global function with 'isolated' parameter cannot have a global actor; this is an error in the Swift 6 language mode}}{{1-12=}}
#if ALLOW_TYPECHECKER_ERRORS

// expected-typechecker-error@+3 {{global function 'allOfEm' has multiple actor-isolation attributes (@MainActor and 'nonisolated')}}
// expected-typechecker-warning@+2 {{global function with 'isolated' parameter cannot be 'nonisolated'; this is an error in the Swift 6 language mode}}{{12-24=}}
// expected-typechecker-warning@+1 {{global function with 'isolated' parameter cannot have a global actor; this is an error in the Swift 6 language mode}}{{1-12=}}
@MainActor nonisolated func allOfEm(_ a: isolated A) {
a.f()
}

#if ALLOW_TYPECHECKER_ERRORS

@MainActor class MAClass {

// expected-typechecker-note@+2 {{previous 'isolated' parameter 'a'}}
Expand Down
4 changes: 2 additions & 2 deletions test/attr/execution_behavior_attrs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ struct TestAttributeCollisions {
}

@MainActor @concurrent func testGlobalActor() async {}
// expected-warning @-1 {{instance method 'testGlobalActor()' has multiple actor-isolation attributes (@MainActor and @concurrent)}}
// expected-error@-1 {{instance method 'testGlobalActor()' has multiple actor-isolation attributes (@MainActor and @concurrent)}}

nonisolated(nonsending) nonisolated func testNonIsolatedCaller() async {} // expected-error {{duplicate modifier}} expected-note {{modifier already specified here}}
@MainActor nonisolated(nonsending) func testGlobalActorCaller() async {}
// expected-warning@-1 {{instance method 'testGlobalActorCaller()' has multiple actor-isolation attributes (@MainActor and 'nonisolated(nonsending)')}}
// expected-error@-1 {{instance method 'testGlobalActorCaller()' has multiple actor-isolation attributes (@MainActor and 'nonisolated(nonsending)')}}
nonisolated(nonsending) func testCaller(arg: isolated MainActor) async {}
// expected-error@-1 {{cannot use 'nonisolated(nonsending)' on instance method 'testCaller(arg:)' because it has an isolated parameter: 'arg'}}

Expand Down
2 changes: 1 addition & 1 deletion test/attr/global_actor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct Container {
// Redundant attributes
// -----------------------------------------------------------------------
extension SomeActor {
@GA1 nonisolated func conflict1() { } // expected-warning {{instance method 'conflict1()' has multiple actor-isolation attributes (@GA1 and 'nonisolated')}}
@GA1 nonisolated func conflict1() { } // expected-error {{instance method 'conflict1()' has multiple actor-isolation attributes (@GA1 and 'nonisolated')}}
}


Expand Down