Skip to content

Commit 191afb0

Browse files
committed
Fix a test on Linux
1 parent eb8b1ab commit 191afb0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/type/subclass_composition.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@ func basicSubtyping(
9999
let _ = Unrelated() as? Derived & P2 // expected-warning {{always fails}}
100100
let _ = baseAndP2 as Unrelated // expected-error {{cannot convert value of type 'Base<Int> & P2' to type 'Unrelated' in coercion}}
101101
let _ = baseAndP2 as? Unrelated // expected-warning {{always fails}}
102-
let _ = Unrelated() as AnyObject
103-
let _ = Unrelated() as? AnyObject // expected-warning {{always succeeds}}
102+
103+
// Different behavior on Linux vs Darwin because of id-as-Any.
104+
// let _ = Unrelated() as AnyObject
105+
// let _ = Unrelated() as? AnyObject
106+
104107
let _ = anyObject as Unrelated // expected-error {{'AnyObject' is not convertible to 'Unrelated'; did you mean to use 'as!' to force downcast?}}
105108
let _ = anyObject as? Unrelated
106109

0 commit comments

Comments
 (0)