mirror of
https://github.com/apple/swift.git
synced 2026-10-28 21:15:56 +01:00
When the type named in a `throws(...)` clause fails to resolve, the effective thrown error type of the declaration is an error type, which tripped an assertion in `Classification::forThrows()`. Errors were already diagnosed by that point, so classify the reference as invalid code instead. Resolves rdar://186881939 and https://github.com/swiftlang/swift/issues/92053.
5 lines
487 B
Swift
5 lines
487 B
Swift
// {"kind":"typecheck","signature":"(anonymous namespace)::Classification::forDeclRef(swift::ConcreteDeclRef, (anonymous namespace)::ConditionalEffectKind, (anonymous namespace)::PotentialEffectReason, swift::SourceLoc, bool, std::__1::optional<swift::EffectKind>)","signatureAssert":"Assertion failed: (!thrownError->hasError()), function forThrows","signatureNext":"ApplyClassifier::classifyDeclRef"}
|
|
// RUN: not %target-swift-frontend -typecheck %s
|
|
var a : String { get throws(b{
|
|
a
|