mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Expand DisallowedOriginKind with an explicit entry for internal bridging headers
This commit is contained in:
@@ -8,4 +8,5 @@ typedef struct {
|
||||
double x, y;
|
||||
} MyPoint;
|
||||
|
||||
typedef double MyDouble;
|
||||
#endif
|
||||
|
||||
@@ -20,3 +20,20 @@ public func getX(point: MyPoint) -> Double { point.x } // expected-error{{functi
|
||||
|
||||
// Comes from the macros module.
|
||||
public func returnsFromMacrosModule() -> okay_t { 0 }
|
||||
|
||||
public protocol P {
|
||||
associatedtype A
|
||||
}
|
||||
|
||||
public struct MyType: P {
|
||||
public typealias A = MyDouble
|
||||
// expected-error@-1{{type alias cannot be declared public because its underlying type uses an internal type}}
|
||||
// expected-note@-2{{type alias 'MyDouble' is imported by this file as 'internal' from bridging header}}
|
||||
}
|
||||
|
||||
// expected-error@+1{{cannot use struct 'MyPoint' in an extension with public or '@usableFromInline' members; it was imported via the internal bridging header}}
|
||||
extension MyPoint: P {
|
||||
public typealias A = MyDouble
|
||||
// expected-error@-1{{type alias cannot be declared public because its underlying type uses an internal type}}
|
||||
// expected-note@-2{{type alias 'MyDouble' is imported by this file as 'internal' from bridging header}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user