forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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: swiftlang#77644
- Loading branch information
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
// RUN: %target-typecheck-verify-swift -verify-ignore-unknown | ||
// 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() { | ||
// FIXME: We shouldn't be failing to produce a diagnostic. | ||
// Once resolved, remove '-verify-ignore-unknown' | ||
bar(X<Int?>.self, .zero) | ||
// expected-error@-1 {{cannot find 'X' in scope}} | ||
// expected-error@-2 {{failed to produce diagnostic for expression}} | ||
} |