mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When an extension is nested inside of an invalid decl context, it is going to pull the signature of its nearest enclosing context instead of its extended type. This leads to a null signature since the nearest enclosing context for an extension should always be its parent source file. rdar://76049852
15 lines
262 B
Swift
15 lines
262 B
Swift
// RUN: not %target-swift-frontend -typecheck %s
|
||
|
||
struct MyStruct {}
|
||
protocol MyProtocol {}
|
||
|
||
func foo(bytes: [MyStruct]) {
|
||
bytes.withUnsafeBufferPointer { a in
|
||
extension MyProtocol {
|
||
var bytes: MyStruct {
|
||
fatalError()
|
||
}
|
||
}
|
||
}
|
||
}
|