mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
While ModuleDecl::lookupConformance() did the right thing here, we have another entry point, TypeChecker::containsProtocol(), that also needs to special-case Error. Fixes https://bugs.swift.org/browse/SR-13734 / rdar://problem/70338670.
13 lines
206 B
Swift
13 lines
206 B
Swift
// RUN: %target-swift-frontend -emit-ir %s
|
|
|
|
public struct X {
|
|
public subscript(_ key: String, as type: Error.Type = Error.self) -> Error? {
|
|
get {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
|
|
let x = X()
|
|
_ = x["hi"]
|