@@ -392,8 +392,6 @@ public func classAssignToVar5() {
392
392
var x2 = Klass ( ) // expected-error {{'x2' used after consume}}
393
393
x2 = Klass ( )
394
394
var x3 = x2 // expected-note {{consuming use here}}
395
- // TODO: Need to mark this as the lifetime extending use. We fail
396
- // appropriately though.
397
395
borrowVal ( x2) // expected-note {{non-consuming use here}}
398
396
x3 = Klass ( )
399
397
consumeVal ( x3)
@@ -1781,15 +1779,12 @@ public func enumPatternMatchIfLet2Arg(_ x2: inout EnumTy) { // expected-error {{
1781
1779
}
1782
1780
}
1783
1781
1784
- // This is wrong.
1785
1782
public func enumPatternMatchSwitch1( ) {
1786
1783
var x2 = EnumTy . klass ( Klass ( ) ) // expected-error {{'x2' used after consume}}
1787
1784
x2 = EnumTy . klass ( Klass ( ) )
1788
1785
switch x2 { // expected-note {{consuming use here}}
1789
1786
case let EnumTy . klass( k) :
1790
1787
borrowVal ( k)
1791
- // This should be flagged as the use after free use. We are atleast
1792
- // erroring though.
1793
1788
borrowVal ( x2) // expected-note {{non-consuming use here}}
1794
1789
case . int:
1795
1790
break
@@ -1800,8 +1795,6 @@ public func enumPatternMatchSwitch1Arg(_ x2: inout EnumTy) { // expected-error {
1800
1795
switch x2 { // expected-note {{consuming use here}}
1801
1796
case let EnumTy . klass( k) :
1802
1797
borrowVal ( k)
1803
- // This should be flagged as the use after free use. We are atleast
1804
- // erroring though.
1805
1798
borrowVal ( x2)
1806
1799
case . int:
1807
1800
break
@@ -2267,8 +2260,6 @@ public func addressOnlyGenericAssignToVar5<T : P>(_ ty: T.Type) {
2267
2260
var x2 = AddressOnlyGeneric < T > ( ) // expected-error {{'x2' used after consume}}
2268
2261
x2 = AddressOnlyGeneric < T > ( )
2269
2262
var x3 = x2 // expected-note {{consuming use here}}
2270
- // TODO: Need to mark this as the lifetime extending use. We fail
2271
- // appropriately though.
2272
2263
borrowVal ( x2) // expected-note {{non-consuming use here}}
2273
2264
x3 = AddressOnlyGeneric < T > ( )
2274
2265
consumeVal ( x3)
@@ -2910,8 +2901,6 @@ public func addressOnlyProtocolAssignToVar5<T : P>(_ ty: T.Type) {
2910
2901
var x2 = AddressOnlyProtocol ( ) // expected-error {{'x2' used after consume}}
2911
2902
x2 = AddressOnlyProtocol ( )
2912
2903
var x3 = x2 // expected-note {{consuming use here}}
2913
- // TODO: Need to mark this as the lifetime extending use. We fail
2914
- // appropriately though.
2915
2904
borrowVal ( x2) // expected-note {{non-consuming use here}}
2916
2905
x3 = AddressOnlyProtocol ( )
2917
2906
consumeVal ( x3)
0 commit comments