mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #37057 from LucianoPAlmeida/placeholder-checkedcast-warn
[Sema] Do not attempt warn extraneous checked cast for placeholder types
This commit is contained in:
@@ -6448,7 +6448,8 @@ static ConstraintFix *maybeWarnAboutExtraneousCast(
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
// Both types have to be fixed.
|
// Both types have to be fixed.
|
||||||
if (fromType->hasTypeVariable() || toType->hasTypeVariable())
|
if (fromType->hasTypeVariable() || toType->hasTypeVariable() ||
|
||||||
|
fromType->hasPlaceholder() || toType->hasPlaceholder())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
SmallVector<LocatorPathElt, 4> path;
|
SmallVector<LocatorPathElt, 4> path;
|
||||||
|
|||||||
@@ -529,3 +529,9 @@ let _ = derived is (SR13899_Derived) -> Void // expected-warning{{'is' test is a
|
|||||||
let _ = derived is (SR13899_Derived) throws -> Void // expected-warning{{'is' test is always true}}
|
let _ = derived is (SR13899_Derived) throws -> Void // expected-warning{{'is' test is always true}}
|
||||||
let _ = blockp is (SR13899_A) -> Void //expected-warning{{'is' test is always true}}
|
let _ = blockp is (SR13899_A) -> Void //expected-warning{{'is' test is always true}}
|
||||||
let _ = blockp is (SR13899_A) throws -> Void //expected-warning{{'is' test is always true}}
|
let _ = blockp is (SR13899_A) throws -> Void //expected-warning{{'is' test is always true}}
|
||||||
|
|
||||||
|
protocol PP1 { }
|
||||||
|
protocol PP2: PP1 { }
|
||||||
|
extension Optional: PP1 where Wrapped == PP2 { }
|
||||||
|
|
||||||
|
nil is PP1 // expected-error {{'nil' requires a contextual type}}
|
||||||
|
|||||||
Reference in New Issue
Block a user