mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
CSDiag was misinterpreting the result of checkGenericArguments(). A result of SubstitutionFailure does not mean a diagnostic was emitted, only a result of Failure means that. This fixes a case where we did not emit a diagnostic, result in a crash on invalid. The diagnostic is still poor, but that's better than crashing. Fixes <https://bugs.swift.org/browse/SR-5932>, <rdar://problem/34522739>.
9 lines
198 B
Swift
9 lines
198 B
Swift
// RUN: not %target-typecheck-verify-swift
|
|
|
|
extension Dictionary {
|
|
func doSomething<T>() -> [T : Value] {
|
|
let pairs: [(T, Value)] = []
|
|
return Dictionary(uniqueKeysWithValues: pairs)
|
|
}
|
|
}
|