 
     // This should produce an error, since x is used within the inner closure.
     doStuff({ [myX = {x}] in 4 })    // expected-error {{reference to property 'x' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{23-23= [self] in }} expected-note{{reference 'self.' explicitly}} {{23-23=self.}}
+    // expected-warning @-1 {{capture 'myX' was never used}}
 
     return 42
   }

  // expected-error@+2{{conflicting arguments to generic parameter 'T' ('()' vs. 'Int')}}
  // expected-note@+1:3{{generic parameter 'T' inferred as 'Int' from context}}
  callitArgs(1) { // expected-note@:17{{generic parameter 'T' inferred as '()' from closure return expression}}
    print("hello") 
  }
}


    
    // If we already have a capture list, self should be added to the list
    let y = 1
    doStuff { [y] in method() } // expected-warning {{capture 'y' was never used}} expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self, }} expected-note{{reference 'self.' explicitly}} {{22-22=self.}}
    doStuff { [ // expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self, }}
        y // expected-warning {{capture 'y' was never used}}
        ] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}}  expected-note{{reference 'self.' explicitly}} {{14-14=self.}}

    // <rdar://problem/18877391> "self." shouldn't be required in the initializer expression in a capture list
