Files
swift-mirror/test/IDE/complete_generic_optional.swift
Doug Gregor 89343e2c98 [Coding] Make Codable conformances for Optional and collections conditional.
Array, Set, Dictionary, and Optional all provide unconditional conformances
to Encodable & Decodable that dynamically check whether their type arguments
are Encodable/Decodable. Now that we have conditional conformances, make
these unconditional conformances properly conditional, removing all of
the Swift 4-era type-erasure hacks.

Fixes rdar://problem/34989162.
2017-11-30 11:06:29 -08:00

17 lines
590 B
Swift

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FOO_OPTIONAL_1 | %FileCheck %s -check-prefix=FOO_OPTIONAL_1
struct Bar {
}
struct Foo<T> {
func myFunction(_ foobar: T) {
}
}
// SR-642 Code completion does not instantiate generic arguments of a type wrapped in an optional
let x: Foo<Bar>? = Foo<Bar>()
x.#^FOO_OPTIONAL_1^#
// FOO_OPTIONAL_1: Begin completions, 6 items
// FOO_OPTIONAL_1-DAG: Decl[InstanceMethod]/CurrNominal/Erase[1]: ?.myFunction({#(foobar): Bar#})[#Void#]; name=myFunction(foobar: Bar)
// FOO_OPTIONAL_1: End completions