diff --git a/lib/Sema/TypeCheckDeclPrimary.cpp b/lib/Sema/TypeCheckDeclPrimary.cpp index a291fb572d1..ab41da9255e 100644 --- a/lib/Sema/TypeCheckDeclPrimary.cpp +++ b/lib/Sema/TypeCheckDeclPrimary.cpp @@ -1653,7 +1653,7 @@ static void diagnoseRetroactiveConformances( proto->walkInheritedProtocols([&](ProtocolDecl *decl) { // Get the original conformance of the extended type to this protocol. - auto conformanceRef = ext->getParentModule()->checkConformance( + auto conformanceRef = ext->getParentModule()->lookupConformance( extendedType, decl); if (!conformanceRef.isConcrete()) { diff --git a/test/IRGen/bitwise-copyable-derived-loadRaw.swift b/test/IRGen/bitwise-copyable-derived-loadRaw.swift index eb33ac7be65..4e86e79e4f9 100644 --- a/test/IRGen/bitwise-copyable-derived-loadRaw.swift +++ b/test/IRGen/bitwise-copyable-derived-loadRaw.swift @@ -6,7 +6,7 @@ public protocol MyBitwiseCopyable : _BitwiseCopyable {} -extension SIMD16 : @retroactive MyBitwiseCopyable where Scalar.SIMD16Storage : MyBitwiseCopyable {} +extension SIMD16 : MyBitwiseCopyable where Scalar.SIMD16Storage : MyBitwiseCopyable {} extension UInt8.SIMD16Storage : MyBitwiseCopyable {} func doit() { diff --git a/test/Sema/extension_retroactive_conformances.swift b/test/Sema/extension_retroactive_conformances.swift index e2fcc14ce44..04f4fe7b415 100644 --- a/test/Sema/extension_retroactive_conformances.swift +++ b/test/Sema/extension_retroactive_conformances.swift @@ -15,6 +15,9 @@ public struct Sample5 {} public struct Sample6 {} public struct SampleAlreadyConforms: SampleProtocol1 {} + +public struct GenericSample1 {} + #else import Library @@ -81,4 +84,9 @@ extension OriginallyDefinedInLibrary: SampleProtocol1 {} // ok, @_originallyDefi #endif +// conditional conformances +extension GenericSample1: SampleProtocol1 where T: SampleProtocol1 {} +// expected-warning@-1 {{extension declares a conformance of imported type 'GenericSample1' to imported protocol 'SampleProtocol1'; this will not behave correctly if the owners of 'Library' introduce this conformance in the future}} +// expected-note@-2 {{add '@retroactive' to silence this warning}} + #endif diff --git a/test/stdlib/SIMD_as_AdditiveArithmetic.swift b/test/stdlib/SIMD_as_AdditiveArithmetic.swift index f2641a396c7..f4dac5deaf4 100644 --- a/test/stdlib/SIMD_as_AdditiveArithmetic.swift +++ b/test/stdlib/SIMD_as_AdditiveArithmetic.swift @@ -1,5 +1,5 @@ // RUN: %target-typecheck-verify-swift -extension SIMD2: AdditiveArithmetic where Scalar: FloatingPoint { } -extension SIMD3: AdditiveArithmetic where Scalar: FloatingPoint { } -extension SIMD4: AdditiveArithmetic where Scalar: FloatingPoint { } -extension SIMD8: AdditiveArithmetic where Scalar: FloatingPoint { } +extension SIMD2: @retroactive AdditiveArithmetic where Scalar: FloatingPoint { } +extension SIMD3: @retroactive AdditiveArithmetic where Scalar: FloatingPoint { } +extension SIMD4: @retroactive AdditiveArithmetic where Scalar: FloatingPoint { } +extension SIMD8: @retroactive AdditiveArithmetic where Scalar: FloatingPoint { }