Files
swift-mirror/validation-test/compiler_crashers_2_fixed/rdar70338670.swift
Slava Pestov 508dc8c0d9 Sema: Handle Error self-conformance in TypeChecker::containsProtocol()
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.
2021-04-14 17:55:43 -04:00

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"]