Files
swift-mirror/validation-test/compiler_crashers_fixed/ApplyClassifier-classifyApply-fa31b7.swift
Allan Shortlidge 75c34c103c Sema: Tolerate an invalid thrown error type during effects checking.
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.
2026-09-16 20:52:33 -07:00

8 lines
729 B
Swift

// {"kind":"typecheck","original":"1d6718e8","signature":"(anonymous namespace)::ApplyClassifier::classifyApply(swift::ApplyExpr*, (anonymous namespace)::AbstractFunction const&, swift::Expr*, swift::AnyFunctionType const*, swift::ArgumentList*, bool, bool, llvm::DenseSet<swift::Expr const*, llvm::DenseMapInfo<swift::Expr const*, void>>*)::'lambda'(swift::EffectKind)::operator()(swift::EffectKind) const","signatureAssert":"Assertion failed: (!thrownError->hasError()), function forThrows","signatureNext":"ApplyClassifier::FunctionThrowsClassifier::checkApply"}
// RUN: not %target-swift-frontend -typecheck %s
struct a: AsyncSequence {
typealias Element = UInt64
let b: UInt64 async
let c = a(b: 0).reduce(0 {
$1