Skip to content

Don't Force the Interface Type While Checking Isolation #37141

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 1 commit into from
Apr 30, 2021
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: 2 additions & 1 deletion lib/Sema/TypeCheckConcurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,8 @@ static Optional<ActorIsolation> getIsolationFromConformances(
return None;

Optional<ActorIsolation> foundIsolation;
for (auto proto : nominal->getLocalProtocols()) {
for (auto proto :
nominal->getLocalProtocols(ConformanceLookupKind::NonStructural)) {
switch (auto protoIsolation = getActorIsolation(proto)) {
case ActorIsolation::ActorInstance:
case ActorIsolation::Unspecified:
Expand Down
3 changes: 3 additions & 0 deletions test/Concurrency/Inputs/sendable_cycle_other.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct Foo {
static let member = Bar()
}
10 changes: 10 additions & 0 deletions test/Concurrency/sendable_cycle.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %target-typecheck-verify-swift %S/Inputs/sendable_cycle_other.swift -enable-experimental-concurrency
// REQUIRES: concurrency

struct Bar {
lazy var foo = {
self.x()
}

func x() -> Int { 42 }
}
3 changes: 0 additions & 3 deletions test/Sema/option-set-empty.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// RUN: %target-typecheck-verify-swift -verify-ignore-unknown

struct SomeOptions: OptionSet {
// expected-error@-1{{circular reference}}
// expected-note@-2 2{{through reference here}}
var rawValue: Int

static let some = MyOptions(rawValue: 4)
Expand All @@ -12,7 +10,6 @@ struct SomeOptions: OptionSet {
let someVal = MyOptions(rawValue: 6)
let option = MyOptions(float: Float.infinity)
let none = SomeOptions(rawValue: 0) // expected-error {{value type 'SomeOptions' cannot have a stored property that recursively contains it}}
// expected-note@-1 3{{through reference here}}
}

struct MyOptions: OptionSet {
Expand Down