File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
validation-test/IDE/crashers_2_fixed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,9 @@ class SanitizeExpr : public ASTWalker {
242
242
if (auto closure = dyn_cast<ClosureExpr>(expr)) {
243
243
if (!shouldTypeCheckInEnclosingExpression (closure))
244
244
return { false , expr };
245
+ for (auto &Param : *closure->getParameters ()) {
246
+ Param->setSpecifier (swift::ParamSpecifier::Default);
247
+ }
245
248
}
246
249
247
250
// Now, we're ready to walk into sub expressions.
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename=%s | %FileCheck %s
2
+
3
+ protocol MyView {
4
+ associatedtype Body : MyView
5
+ @MyViewBuilder var body : Self . Body { get }
6
+ }
7
+
8
+ @resultBuilder public struct MyViewBuilder {
9
+ static func buildBlock( ) -> MyZStack < Never > { fatalError ( ) }
10
+ static func buildBlock< Content> ( _ content: Content ) -> Content { content }
11
+ }
12
+
13
+ struct MyAlignment {
14
+ static let center : MyAlignment
15
+ }
16
+
17
+ struct MyZStack < Content> : MyView {
18
+ init ( alignment: MyAlignment , @MyViewBuilder content: ( ) -> Content ) {
19
+ fatalError ( )
20
+ }
21
+
22
+ func my_updating< State> ( body: ( inout State ) -> Void ) { }
23
+ }
24
+
25
+ struct BottomMenu : MyView {
26
+ var body : some MyView {
27
+ let a = MyZStack ( alignment: . #^COMPLETE^#center, content: { } )
28
+ . my_updating ( body: { state in
29
+ state = false
30
+ } )
31
+ }
32
+ }
33
+
34
+ // CHECK: Begin completions, 2 items
35
+ // CHECK: Decl[StaticVar]/ExprSpecific/TypeRelation[Identical]: center[#MyAlignment#]; name=center
36
+ // CHECK: Decl[Constructor]/CurrNominal/TypeRelation[Identical]: init()[#MyAlignment#]; name=init()
37
+ // CHECK: End completions
You can’t perform that action at this time.
0 commit comments