Files
swift-mirror/test/Constraints/rdar139913219.swift
Pavel Yaskevich 30c196118e [CSSimplify] Handle invalid type specializations
If the base type of the specialization is invalid,
the AST node is going to be replaced with `ErrorExpr`.

We need to handle that gracefully when attempting
to apply specialization in such situations.

Resolves: https://github.com/swiftlang/swift/issues/77644
2024-11-15 11:10:51 -08:00

12 lines
255 B
Swift

// RUN: %target-typecheck-verify-swift
// rdar://139913219 - Make sure we don't crash.
func bar(_ x: Int.Type, _: Int) {}
func bar<T>(_ x: T.Type, _: Int) {}
func foo() {
bar(X<Int?>.self, .zero)
// expected-error@-1 {{cannot find 'X' in scope}}
}