Files
swift-mirror/test/Constraints/invalid_stdlib_2.swift
Luciano Almeida 1184492d25 [Diagnostics] SR-11419 Diagnose protocol stub note in editor mode only (#28101)
* [TypeChecker] Enclosing stubs protocol note within editor mode

* [test] Removing note from test where there is no -diagnostics-editor-mode flag

* Formatting modified code

* [tests] Fixing tests under validation-tests
2019-11-06 07:42:48 -08:00

14 lines
479 B
Swift

// RUN: %target-typecheck-verify-swift
class Dictionary<K, V> : ExpressibleByDictionaryLiteral { // expected-error {{type 'Dictionary<K, V>' does not conform to protocol 'ExpressibleByDictionaryLiteral'}}
typealias Key = K
typealias Value = V
init(dictionaryLiteral xs: (K)...){} // expected-note {{candidate has non-matching type '(dictionaryLiteral: (K)...)'}}
}
func useDict<K, V>(_ d: Dictionary<K,V>) {}
useDict(["Hello" : 1])
useDict(["Hello" : 1, "World" : 2])