|
| 1 | +struct MyValue { |
| 2 | + var value = 1 |
| 3 | +} |
| 4 | +func foo(fn: () -> Void) {} |
| 5 | +_ = foo { |
| 6 | + func innerFunc(value: MyValue) { |
| 7 | + value. // HERE |
| 8 | + } |
| 9 | +} |
| 10 | + |
| 11 | +struct MyStruct { |
| 12 | + var x = { () -> Int in |
| 13 | + class InnerC { |
| 14 | + init(value: MyValue) { |
| 15 | + value. // HERE |
| 16 | + } |
| 17 | + } |
| 18 | + }() |
| 19 | +} |
| 20 | + |
| 21 | +// RUN: %sourcekitd-test \ |
| 22 | +// RUN: -req=track-compiles == \ |
| 23 | +// RUN: -req=complete -pos=7:11 -repeat-request=2 %s -- %s -parse-as-library == \ |
| 24 | +// RUN: -req=complete -pos=15:15 -repeat-request=2 %s -- %s -parse-as-library \ |
| 25 | +// RUN: > %t.response.library |
| 26 | +// RUN: %FileCheck --check-prefix=RESULT %s < %t.response.library |
| 27 | +// RUN: %FileCheck --check-prefix=LIB_TRACE %s < %t.response.library |
| 28 | + |
| 29 | +// RESULT-LABEL: key.results: [ |
| 30 | +// RESULT: key.description: "value" |
| 31 | +// RESULT-LABEL: key.results: [ |
| 32 | +// RESULT: key.description: "value" |
| 33 | +// RESULT-LABEL: key.results: [ |
| 34 | +// RESULT: key.description: "value" |
| 35 | +// RESULT-LABEL: key.results: [ |
| 36 | +// RESULT: key.description: "value" |
| 37 | + |
| 38 | +// LIB_TRACE-NOT: key.description: "completion reusing previous ASTContext (benign diagnostic)" |
| 39 | + |
| 40 | +// RUN: %sourcekitd-test \ |
| 41 | +// RUN: -req=track-compiles == \ |
| 42 | +// RUN: -req=complete -pos=7:11 -repeat-request=2 %s -- %s == \ |
| 43 | +// RUN: -req=complete -pos=15:15 -repeat-request=2 %s -- %s \ |
| 44 | +// RUN: > %t.response.script |
| 45 | +// RUN: %FileCheck --check-prefix=RESULT %s < %t.response.script |
| 46 | +// RUN: %FileCheck --check-prefix=SCRIPT_TRACE %s < %t.response.script |
| 47 | + |
| 48 | +// SCRIPT_TRACE-LABEL: key.notification: source.notification.compile-did-finish, |
| 49 | +// SCRIPT_TRACE-NOT: key.description: "completion reusing previous ASTContext (benign diagnostic)" |
| 50 | +// SCRIPT_TRACE-LABEL: key.notification: source.notification.compile-did-finish, |
| 51 | +// SCRIPT_TRACE: key.description: "completion reusing previous ASTContext (benign diagnostic)" |
| 52 | +// SCRIPT_TRACE-LABEL: key.notification: source.notification.compile-did-finish, |
| 53 | +// SCRIPT_TRACE: key.description: "completion reusing previous ASTContext (benign diagnostic)" |
| 54 | +// SCRIPT_TRACE-LABEL: key.notification: source.notification.compile-did-finish, |
| 55 | +// SCRIPT_TRACE: key.description: "completion reusing previous ASTContext (benign diagnostic)" |
0 commit comments