Files
swift-mirror/validation-test/compiler_crashers_2_fixed/rdar76049852.swift
Robert Widmann 9e496d38f9 Add a Null Check for Missing Generic Signatures
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
2021-04-02 09:43:35 -07:00

15 lines
262 B
Swift
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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()
  }
}
}
}