|
362 | 362 | // RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.types.txt
|
363 | 363 |
|
364 | 364 |
|
365 |
| -// FIXME: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPE_IDENTIFIER_GENERIC_1 > %t.types.txt |
366 |
| -// FIXME: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_1 < %t.types.txt |
| 365 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPE_IDENTIFIER_GENERIC_1 > %t.types.txt |
| 366 | +// RUN: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_1 < %t.types.txt |
367 | 367 | // RUN: %FileCheck %s -check-prefix=WITHOUT_GLOBAL_TYPES < %t.types.txt
|
368 | 368 | // RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.types.txt
|
369 | 369 |
|
370 | 370 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPE_IDENTIFIER_GENERIC_2 > %t.types.txt
|
371 |
| -// FIXME: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_2 < %t.types.txt |
| 371 | +// RUN: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_2 < %t.types.txt |
372 | 372 | // RUN: %FileCheck %s -check-prefix=WITHOUT_GLOBAL_TYPES < %t.types.txt
|
373 | 373 | // RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.types.txt
|
374 | 374 |
|
|
386 | 386 | // RUN: %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES < %t.gentypealias.txt
|
387 | 387 | // RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.gentypealias.txt
|
388 | 388 |
|
| 389 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_TOPLEVEL_VAR | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 390 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_TOPLEVEL_PARAM | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 391 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_TOPLEVEL_RETURN | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 392 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_MEMBER_VAR | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 393 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_MEMBER_PARAM | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 394 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_MEMBER_RETURN | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 395 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_LOCAL_VAR | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 396 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_LOCAL_PARAM | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 397 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_LOCAL_RETURN | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES |
| 398 | + |
389 | 399 | //===--- Helper types that are used in this test
|
390 | 400 |
|
391 | 401 | struct FooStruct {
|
@@ -1003,20 +1013,18 @@ func testTypeIdentifierGeneric1<
|
1003 | 1013 | >(a: GenericFoo.#^TYPE_IDENTIFIER_GENERIC_1^#
|
1004 | 1014 |
|
1005 | 1015 | // TYPE_IDENTIFIER_GENERIC_1: Begin completions
|
1006 |
| -// TYPE_IDENTIFIER_GENERIC_1-NEXT: Decl[TypeAlias]/Super: FooTypeAlias1{{; name=.+$}} |
| 1016 | +// TYPE_IDENTIFIER_GENERIC_1-NEXT: Decl[AssociatedType]/Super: FooTypeAlias1{{; name=.+$}} |
1007 | 1017 | // TYPE_IDENTIFIER_GENERIC_1-NEXT: Keyword/None: Type[#GenericFoo.Type#]
|
1008 |
| -// TYPE_IDENTIFIER_GENERIC_1-NEXT: Keyword/None: self[#GenericFoo#] |
1009 | 1018 | // TYPE_IDENTIFIER_GENERIC_1-NEXT: End completions
|
1010 | 1019 |
|
1011 | 1020 | func testTypeIdentifierGeneric2<
|
1012 | 1021 | GenericFoo : FooProtocol & BarProtocol
|
1013 | 1022 | >(a: GenericFoo.#^TYPE_IDENTIFIER_GENERIC_2^#
|
1014 | 1023 |
|
1015 | 1024 | // TYPE_IDENTIFIER_GENERIC_2: Begin completions
|
1016 |
| -// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[TypeAlias]/Super: BarTypeAlias1{{; name=.+$}} |
1017 |
| -// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[TypeAlias]/Super: FooTypeAlias1{{; name=.+$}} |
| 1025 | +// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[AssociatedType]/Super: BarTypeAlias1{{; name=.+$}} |
| 1026 | +// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[AssociatedType]/Super: FooTypeAlias1{{; name=.+$}} |
1018 | 1027 | // TYPE_IDENTIFIER_GENERIC_2-NEXT: Keyword/None: Type[#GenericFoo.Type#]
|
1019 |
| -// TYPE_IDENTIFIER_GENERIC_2-NEXT: Keyword/None: self[#GenericFoo#] |
1020 | 1028 | // TYPE_IDENTIFIER_GENERIC_2-NEXT: End completions
|
1021 | 1029 |
|
1022 | 1030 | func testTypeIdentifierGeneric3<
|
@@ -1058,3 +1066,19 @@ func testGenericTypealias2() {
|
1058 | 1066 | typealias MyPair<T> = (T, T)
|
1059 | 1067 | let x: MyPair<#^GENERIC_TYPEALIAS_2^#>
|
1060 | 1068 | }
|
| 1069 | + |
| 1070 | +// In generic argument |
| 1071 | +struct GenStruct<T> { } |
| 1072 | +let a : GenStruct<#^GENERIC_ARGS_TOPLEVEL_VAR^# |
| 1073 | +func foo1(x: GenStruct<#^GENERIC_ARGS_TOPLEVEL_PARAM^# |
| 1074 | +func foo2() -> GenStruct<#^GENERIC_ARGS_TOPLEVEL_RETURN^# |
| 1075 | +class _TestForGenericArg_ { |
| 1076 | + let a : GenStruct<#^GENERIC_ARGS_MEMBER_VAR^# |
| 1077 | + func foo1(x: GenStruct<#^GENERIC_ARGS_MEMBER_PARAM^# |
| 1078 | + func foo2() -> GenStruct<#^GENERIC_ARGS_MEMBER_RETURN^# |
| 1079 | +} |
| 1080 | +func _testForGenericArg_() { |
| 1081 | + let a : GenStruct<#^GENERIC_ARGS_LOCAL_VAR^# |
| 1082 | + func foo1(x: GenStruct<#^GENERIC_ARGS_LOCAL_PARAM^# |
| 1083 | + func foo2() -> GenStruct<#^GENERIC_ARGS_LOCAL_RETURN^# |
| 1084 | +} |
0 commit comments