Files
swift-mirror/validation-test/compiler_crashers_2_fixed/sr-5836.swift
Slava Pestov 044af751f3 Sema: Fix a failure to emit a diagnostic
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>.
2017-09-27 16:39:06 -07:00

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)
}
}