Skip to content

Commit c4ee22c

Browse files
committed
Added a test to check the fix-it works correctly
1 parent ce69f1d commit c4ee22c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/attr/attr_noescape.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
@noescape var fn : () -> Int = { 4 } // expected-error {{@noescape may only be used on 'parameter' declarations}} {{1-11=}}
44

5+
func appliedToType(g: @noescape ()->Void) { g() } // expected-error {{attribute can only be applied to declarations, not types}} {{20-20=@noescape }} {{23-33=}}
6+
57
func doesEscape(fn : () -> Int) {}
68

79
func takesGenericClosure<T>(a : Int, @noescape _ fn : () -> T) {}

0 commit comments

Comments
 (0)