Expand DisallowedOriginKind with an explicit entry for internal bridging headers

This commit is contained in:
Doug Gregor
2025-09-22 10:38:06 -07:00
parent d04e6dd881
commit b7a83495fa
6 changed files with 35 additions and 3 deletions

View File

@@ -8,4 +8,5 @@ typedef struct {
double x, y;
} MyPoint;
typedef double MyDouble;
#endif

View File

@@ -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}}
}