print_usrs_opaque_types.swift (swift-swift-5.8-RELEASE) | : | print_usrs_opaque_types.swift (swift-swift-5.8.1-RELEASE) | ||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
// opaque result types, even in the presence of errors or unusual generic | // opaque result types, even in the presence of errors or unusual generic | |||
// signatures. | // signatures. | |||
// RUN: %target-typecheck-verify-swift -disable-availability-checking | // RUN: %target-typecheck-verify-swift -disable-availability-checking | |||
// RUN: %target-swift-ide-test -print-usrs -source-filename %s | %FileCheck -str ict-whitespace %s | // RUN: %target-swift-ide-test -print-usrs -source-filename %s | %FileCheck -str ict-whitespace %s | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C21UnifyingGenericParams1xQr x_tq_Rszr0_lF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C21UnifyingGenericParams1xQr x_tq_Rszr0_lF | |||
func testUnifyingGenericParams<T, U>(x: T) -> some Collection where T == U { | func testUnifyingGenericParams<T, U>(x: T) -> some Collection where T == U { | |||
// expected-warning@-1 {{same-type requirement makes generic parameters 'U' an d 'T' equivalent}} | // expected-warning@-1 {{same-type requirement makes generic parameters 'U' an d 'T' equivalent}} | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type}} | ||||
} | } | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C22UnifyingGenericParams21xQ rx_tSlRz7ElementQzRs_r0_lF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C22UnifyingGenericParams21xQ rx_tSlRz7ElementQzRs_r0_lF | |||
func testUnifyingGenericParams2<T, U>(x: T) -> some Collection where T: Collecti on, U == T.Element { | func testUnifyingGenericParams2<T, U>(x: T) -> some Collection where T: Collecti on, U == T.Element { | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type}} | ||||
} | } | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C24ConcretizingGenericParam1 xQrSi_tSiRszlF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C24ConcretizingGenericParam1 xQrSi_tSiRszlF | |||
func testConcretizingGenericParam<T>(x: T) -> some Collection where T == Int { | func testConcretizingGenericParam<T>(x: T) -> some Collection where T == Int { | |||
// expected-warning@-1 {{same-type requirement makes generic parameter 'T' non -generic}} | // expected-warning@-1 {{same-type requirement makes generic parameter 'T' non -generic}} | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type}} | ||||
} | } | |||
struct GenericContext<T> { | struct GenericContext<T> { | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextV0c8Unifyin gD6Params1xQrx_tqd__RszlF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextV0c8Unifyin gD6Params1xQrx_tqd__RszlF | |||
func testUnifyingGenericParams<U>(x: T) -> some Collection where T == U { | func testUnifyingGenericParams<U>(x: T) -> some Collection where T == U { | |||
// expected-warning@-1 {{same-type requirement makes generic parameters 'U' and 'T' equivalent}} | // expected-warning@-1 {{same-type requirement makes generic parameters 'U' and 'T' equivalent}} | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type} } | ||||
} | } | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextV0c8Unifyin gD7Params21xQrx_tSlRz7ElementQzRsd__lF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextV0c8Unifyin gD7Params21xQrx_tSlRz7ElementQzRsd__lF | |||
func testUnifyingGenericParams2<U>(x: T) -> some Collection where T: Collectio n, U == T.Element { | func testUnifyingGenericParams2<U>(x: T) -> some Collection where T: Collectio n, U == T.Element { | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type} } | ||||
} | } | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVyQrxcqd__R szluip | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVyQrxcqd__R szluip | |||
subscript<U>(x: T) -> some Collection where T == U { | subscript<U>(x: T) -> some Collection where T == U { | |||
// expected-warning@-1 {{same-type requirement makes generic parameters 'U' and 'T' equivalent}} | // expected-warning@-1 {{same-type requirement makes generic parameters 'U' and 'T' equivalent}} | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVyQrxcqd_ _Rszluig | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVyQrxcqd_ _Rszluig | |||
get { | get { | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit typ e}} | ||||
} | } | |||
} | } | |||
} | } | |||
extension GenericContext where T == Int { | extension GenericContext where T == Int { | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVAASiRszlE0 c12ConcretizingD5Param1xQrSi_tF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVAASiRszlE0 c12ConcretizingD5Param1xQrSi_tF | |||
func testConcretizingGenericParam(x: T) -> some Collection { | func testConcretizingGenericParam(x: T) -> some Collection { | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type} } | ||||
} | } | |||
} | } | |||
struct TooGenericTooContext<T, U> { | struct TooGenericTooContext<T, U> { | |||
} | } | |||
extension TooGenericTooContext where T == U { | extension TooGenericTooContext where T == U { | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAAq_ RszrlE0c8UnifyingE6Params1xQrx_tF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAAq_ RszrlE0c8UnifyingE6Params1xQrx_tF | |||
func testUnifyingGenericParams(x: T) -> some Collection { | func testUnifyingGenericParams(x: T) -> some Collection { | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type} } | ||||
} | } | |||
} | } | |||
extension TooGenericTooContext where T: Collection, U == T.Element { | extension TooGenericTooContext where T: Collection, U == T.Element { | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAASl Rz7ElementQzRs_rlE0c8UnifyingE7Params21xQrx_tF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAASl Rz7ElementQzRs_rlE0c8UnifyingE7Params21xQrx_tF | |||
func testUnifyingGenericParams2(x: T) -> some Collection { | func testUnifyingGenericParams2(x: T) -> some Collection { | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type} } | ||||
} | } | |||
} | } | |||
extension TooGenericTooContext where T == Int { | extension TooGenericTooContext where T == Int { | |||
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAASi RszrlE0c12ConcretizingE5Param1xQrSi_tF | // CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAASi RszrlE0c12ConcretizingE5Param1xQrSi_tF | |||
func testConcretizingGenericParam(x: T) -> some Collection { | func testConcretizingGenericParam(x: T) -> some Collection { | |||
return [] | return [] | |||
// expected-warning@-1 {{empty collection literal requires an explicit type} } | ||||
} | } | |||
} | } | |||
End of changes. 10 change blocks. | ||||
10 lines changed or deleted | 0 lines changed or added |