Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 52 additions & 112 deletions test/IDE/complete_in_closures.swift
Original file line number Diff line number Diff line change
@@ -1,65 +1,5 @@
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_CLOSURE_PARAM_1 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_CLOSURE_PARAM_2 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_1 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_2 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_3 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_4 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_5 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_6 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_3 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_4 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_5 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_6 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_7 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_8 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_9 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_10 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS_AND_LOCAL1

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_2 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_3 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_4 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_5 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_6 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_7 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_8 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_9 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_10 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_11 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_12 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_13 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_14 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_15 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_16 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_17 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_18 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_19 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_INHERITANCE_IN_CLOSURE_0 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_INHERITANCE_IN_CLOSURE_0 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARGUMENT_TYPE_IN_CLOSURE_0 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_INHERITANCE_IN_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_INHERITANCE_IN_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARGUMENT_TYPE_IN_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_INHERITANCE_IN_CLOSURE_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_INHERITANCE_IN_CLOSURE_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARGUMENT_TYPE_IN_CLOSURE_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_PARAM_1 | %FileCheck %s -check-prefix=CLOSURE_PARAM_1
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_PARAM_2 | %FileCheck %s -check-prefix=CLOSURE_PARAM_2
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_1 | %FileCheck %s -check-prefix=IN_IIFE_1
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_2 | %FileCheck %s -check-prefix=IN_IIFE_1
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_3 | %FileCheck %s -check-prefix=IN_IIFE_1
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_4 | %FileCheck %s -check-prefix=IN_IIFE_1
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ERROR_IN_CLOSURE_IN_INITIALIZER | %FileCheck %s -check-prefix=ERROR_IN_CLOSURE_IN_INITIALIZER
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DECL_IN_CLOSURE_IN_TOPLEVEL_INIT | %FileCheck %s -check-prefix=DECL_IN_CLOSURE_IN_TOPLEVEL_INIT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=SINGLE_EXPR_CLOSURE_CONTEXT | %FileCheck %s -check-prefix=SINGLE_EXPR_CLOSURE_CONTEXT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=SINGLE_TERNARY_EXPR_CLOSURE_CONTEXT | %FileCheck %s -check-prefix=SINGLE_TERNARY_EXPR_CLOSURE_CONTEXT

// RUN: %empty-directory(%t)
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t

// ERROR_COMMON: found code completion token
// ERROR_COMMON-NOT: Begin completions
Expand All @@ -85,74 +25,74 @@ struct FooStruct {
//===--- Check that we can resolve closure parameters.

func testResolveClosureParam1() {
var x = { (fs: FooStruct) in fs.#^RESOLVE_CLOSURE_PARAM_1^# }
var x = { (fs: FooStruct) in fs.#^RESOLVE_CLOSURE_PARAM_1?check=FOO_OBJECT_DOT^# }
}

func testResolveClosureParam2() {
{ (fs: FooStruct) in fs.#^RESOLVE_CLOSURE_PARAM_2^# }
{ (fs: FooStruct) in fs.#^RESOLVE_CLOSURE_PARAM_2?check=FOO_OBJECT_DOT^# }
}

//===--- Check that we can resolve parent function parameters.

func testResolveParentParam1(_ fs: FooStruct) {
{ (a: Int) in fs.#^RESOLVE_PARENT_PARAM_1^# }
{ (a: Int) in fs.#^RESOLVE_PARENT_PARAM_1?check=FOO_OBJECT_DOT^# }
}

func testResolveParentParam2(_ fs: FooStruct) {
{ fs.#^RESOLVE_PARENT_PARAM_2^# }
{ fs.#^RESOLVE_PARENT_PARAM_2?check=FOO_OBJECT_DOT^# }
}

class TestResolveParentParam3 {
func testResolveParentParam3a(_ fs: FooStruct) {
{ (a: Int) in fs.#^RESOLVE_PARENT_PARAM_3^# }
{ (a: Int) in fs.#^RESOLVE_PARENT_PARAM_3?check=FOO_OBJECT_DOT^# }
}
}

class TestResolveParentParam4 {
func testResolveParentParam4a(_ fs: FooStruct) {
{ fs.#^RESOLVE_PARENT_PARAM_4^# }
{ fs.#^RESOLVE_PARENT_PARAM_4?check=FOO_OBJECT_DOT^# }
}
}

func testResolveParentParam5(_ fs: FooStruct) {
func testResolveParentParam5a() {
{ fs.#^RESOLVE_PARENT_PARAM_5^# }
{ fs.#^RESOLVE_PARENT_PARAM_5?check=FOO_OBJECT_DOT^# }
}
}

func testResolveParentParam6() {
func testResolveParentParam6a(_ fs: FooStruct) {
{ fs.#^RESOLVE_PARENT_PARAM_6^# }
{ fs.#^RESOLVE_PARENT_PARAM_6?check=FOO_OBJECT_DOT^# }
}
}

//===--- Test completion in various statements in closures.

func testReturnInClosure1() {
var f = { () -> Int in
return #^RETURN_1^#
return #^RETURN_1?check=WITH_GLOBAL_DECLS^#
}
}

//===--- Test that we do delayed parsing of closures.

var topLevelClosure1 = { #^DELAYED_1^# }
var topLevelClosure1 = { #^DELAYED_1?check=WITH_GLOBAL_DECLS^# }

var topLevelClosure2 = { func f() { #^DELAYED_2^# } }
var topLevelClosure2 = { func f() { #^DELAYED_2?check=WITH_GLOBAL_DECLS^# } }

var topLevelClosure3 = { class C { func f() { #^DELAYED_3^# } } }
var topLevelClosure3 = { class C { func f() { #^DELAYED_3?check=WITH_GLOBAL_DECLS^# } } }

class ClassWithClosureMember1 {
var c1 = { #^DELAYED_4^# }
lazy var c2 = { #^DELAYED_5^# }
var c3 = ({ #^DELAYED_6^# })()
lazy var c4 = ({ #^DELAYED_7^# })()
var c1 = { #^DELAYED_4?check=WITH_GLOBAL_DECLS^# }
lazy var c2 = { #^DELAYED_5?check=WITH_GLOBAL_DECLS^# }
var c3 = ({ #^DELAYED_6?check=WITH_GLOBAL_DECLS^# })()
lazy var c4 = ({ #^DELAYED_7?check=WITH_GLOBAL_DECLS^# })()
}

struct NestedStructWithClosureMember1 {
struct Nested {
var c1 = { #^DELAYED_8^# }
lazy var c2 = { #^DELAYED_9^# }
var c1 = { #^DELAYED_8?check=WITH_GLOBAL_DECLS^# }
lazy var c2 = { #^DELAYED_9?check=WITH_GLOBAL_DECLS^# }
}
}

Expand All @@ -164,32 +104,32 @@ struct NestedStructWithClosureMember1 {
struct StructWithClosureMemberAndLocal {
var c = {
var x = 0
#^DELAYED_10^#
#^DELAYED_10?check=WITH_GLOBAL_DECLS_AND_LOCAL1^#
}
}

func acceptsTrailingClosureFooVoid(_ code: (FooStruct) -> Void) {}

acceptsTrailingClosureFooVoid {
#^IN_TRAILING_CLOSURE_1^#
#^IN_TRAILING_CLOSURE_1?check=WITH_GLOBAL_DECLS^#
}

acceptsTrailingClosureFooVoid {
$0.#^IN_TRAILING_CLOSURE_2^#
$0.#^IN_TRAILING_CLOSURE_2?check=FOO_OBJECT_DOT^#
}

acceptsTrailingClosureFooVoid {
item in #^IN_TRAILING_CLOSURE_3^#
item in #^IN_TRAILING_CLOSURE_3?check=WITH_GLOBAL_DECLS^#
}

acceptsTrailingClosureFooVoid {
item in item.#^IN_TRAILING_CLOSURE_4^#
item in item.#^IN_TRAILING_CLOSURE_4?check=FOO_OBJECT_DOT^#
}

acceptsTrailingClosureFooVoid {
item in
item.instanceFunc0()
item.#^IN_TRAILING_CLOSURE_5^#
item.#^IN_TRAILING_CLOSURE_5?check=FOO_OBJECT_DOT^#
}

func acceptsListAndTrailingClosureFooVoid(
Expand All @@ -198,70 +138,70 @@ func acceptsListAndTrailingClosureFooVoid(

acceptsListAndTrailingClosureFooVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
#^IN_TRAILING_CLOSURE_6^#
#^IN_TRAILING_CLOSURE_6?check=WITH_GLOBAL_DECLS^#
}

acceptsListAndTrailingClosureFooVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
$0.#^IN_TRAILING_CLOSURE_7^#
$0.#^IN_TRAILING_CLOSURE_7?check=FOO_OBJECT_DOT^#
}

acceptsListAndTrailingClosureFooVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
item in #^IN_TRAILING_CLOSURE_8^#
item in #^IN_TRAILING_CLOSURE_8?check=WITH_GLOBAL_DECLS^#
}

acceptsListAndTrailingClosureFooVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
item in item.#^IN_TRAILING_CLOSURE_9^#
item in item.#^IN_TRAILING_CLOSURE_9?check=FOO_OBJECT_DOT^#
}

acceptsListAndTrailingClosureFooVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
item in
item.instanceFunc0()
item.#^IN_TRAILING_CLOSURE_10^#
item.#^IN_TRAILING_CLOSURE_10?check=FOO_OBJECT_DOT^#
}

func acceptsListAndTrailingClosureTVoid<T>(_ list: [T], code: (T) -> Void) {}

acceptsListAndTrailingClosureTVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
#^IN_TRAILING_CLOSURE_11^#
#^IN_TRAILING_CLOSURE_11?check=WITH_GLOBAL_DECLS^#
}

acceptsListAndTrailingClosureTVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
$0.#^IN_TRAILING_CLOSURE_12^#
$0.#^IN_TRAILING_CLOSURE_12?check=FOO_OBJECT_DOT^#
}

acceptsListAndTrailingClosureTVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
item in #^IN_TRAILING_CLOSURE_13^#
item in #^IN_TRAILING_CLOSURE_13?check=WITH_GLOBAL_DECLS^#
}

acceptsListAndTrailingClosureTVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
item in item.#^IN_TRAILING_CLOSURE_14^#
item in item.#^IN_TRAILING_CLOSURE_14?check=FOO_OBJECT_DOT^#
}

acceptsListAndTrailingClosureTVoid(
[ FooStruct(instanceVar: 0), FooStruct(instanceVar: 0) ]) {
item in
item.instanceFunc0()
item.#^IN_TRAILING_CLOSURE_15^#
item.#^IN_TRAILING_CLOSURE_15?check=FOO_OBJECT_DOT^#
}

func getInt() -> Int? { return 0 }
func testAcceptsTrailingClosureInt1() {
acceptsTrailingClosureFooVoid { #^IN_TRAILING_CLOSURE_16^# in
acceptsTrailingClosureFooVoid { #^IN_TRAILING_CLOSURE_16?check=WITH_GLOBAL_DECLS^# in
if let myvar = getInt() {
}
}
}
func testAcceptsTrailingClosureInt2() {
acceptsTrailingClosureFooVoid {
#^IN_TRAILING_CLOSURE_17^#
#^IN_TRAILING_CLOSURE_17?check=WITH_GLOBAL_DECLS^#
if let myvar = getInt() {
}
}
Expand All @@ -270,55 +210,55 @@ func testAcceptsTrailingClosureInt3() {
acceptsTrailingClosureFooVoid {
if let myvar = getInt() {
}
#^IN_TRAILING_CLOSURE_18^#
#^IN_TRAILING_CLOSURE_18?check=WITH_GLOBAL_DECLS^#
}
}
func testAcceptsTrailingClosureInt4() {
acceptsTrailingClosureFooVoid {
if let myvar = getInt() {
#^IN_TRAILING_CLOSURE_19^#
#^IN_TRAILING_CLOSURE_19?check=WITH_GLOBAL_DECLS^#
}
}
}

func testTypeInClosure1() {
acceptsTrailingClosureFooVoid {
struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_0^#
struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_0?check=WITH_GLOBAL_DECLS^#
}
}
func testTypeInClosure2() {
acceptsTrailingClosureFooVoid {
class S : #^CLASS_INHERITANCE_IN_CLOSURE_0^#
class S : #^CLASS_INHERITANCE_IN_CLOSURE_0?check=WITH_GLOBAL_DECLS^#
}
}
func testTypeInClosure3() {
acceptsTrailingClosureFooVoid {
func test(_ x: #^ARGUMENT_TYPE_IN_CLOSURE_0^#
func test(_ x: #^ARGUMENT_TYPE_IN_CLOSURE_0?check=WITH_GLOBAL_DECLS^#
}
}
acceptsTrailingClosureFooVoid {
struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_1^#
struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_1?check=WITH_GLOBAL_DECLS^#
}
acceptsTrailingClosureFooVoid {
class S : #^CLASS_INHERITANCE_IN_CLOSURE_1^#
class S : #^CLASS_INHERITANCE_IN_CLOSURE_1?check=WITH_GLOBAL_DECLS^#
}
acceptsTrailingClosureFooVoid {
func test(_ x: #^ARGUMENT_TYPE_IN_CLOSURE_1^#
func test(_ x: #^ARGUMENT_TYPE_IN_CLOSURE_1?check=WITH_GLOBAL_DECLS^#
}

struct LazyVar1 {
lazy var x: Int = {
struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_2^#
struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_2?check=WITH_GLOBAL_DECLS^#
}()
}
struct LazyVar2 {
lazy var x: Int = {
class S : #^CLASS_INHERITANCE_IN_CLOSURE_2^#
class S : #^CLASS_INHERITANCE_IN_CLOSURE_2?check=WITH_GLOBAL_DECLS^#
}()
}
struct LazyVar3 {
lazy var x: Int = {
func test(_ x: #^ARGUMENT_TYPE_IN_CLOSURE_2^#
func test(_ x: #^ARGUMENT_TYPE_IN_CLOSURE_2?check=WITH_GLOBAL_DECLS^#
}()
}

Expand Down Expand Up @@ -355,19 +295,19 @@ var testIIFEVar: BarStruct = {
}()
testIIFEVar = {
var obj = BarStruct()
obj.enumVal = .#^IN_IIFE_2^#
obj.enumVal = .#^IN_IIFE_2?check=IN_IIFE_1^#
return obj
}()

func testIIFE() {
var testIIFEVar: FooStruct = {
var obj = BarStruct()
obj.enumVal = .#^IN_IIFE_3^#
obj.enumVal = .#^IN_IIFE_3?check=IN_IIFE_1^#
return obj
}()
testIIFEVar = {
var obj = BarStruct()
obj.enumVal = .#^IN_IIFE_4^#
obj.enumVal = .#^IN_IIFE_4?check=IN_IIFE_1^#
return obj
}()
}
Expand Down
Loading