|
1 | 1 | // RUN: %target-swift-ide-test -print-expr-type -source-filename %S/Inputs/ExprType.swift -swift-version 5 | %FileCheck %s -check-prefix=CHECK-SUGAR
|
2 | 2 | // RUN: %target-swift-ide-test -print-expr-type -source-filename %S/Inputs/ExprType.swift -swift-version 5 -canonicalize-type | %FileCheck %s -check-prefix=CHECK-CANON
|
3 | 3 |
|
4 |
| -// CHECK-SUGAR: func foo() -> Int { return <expr type:"Int">1</expr> } |
5 |
| -// CHECK-SUGAR: func bar(f: Float) -> Float { return <expr type:"Float"><expr type:"(Float) -> Float">bar</expr>(f: <expr type:"Float">1</expr>)</expr> } |
6 |
| -// CHECK-SUGAR: func fooP(_ p: P) { <expr type:"()"><expr type:"(P) -> ()">fooP</expr>(<expr type:"P">p</expr>)</expr> } |
7 |
| -// CHECK-SUGAR: <expr type:"()"><expr type:"Int">_</expr> = <expr type:"Int"><expr type:"[C]">a</expr>.count</expr></expr> |
8 |
| -// CHECK-SUGAR: <expr type:"()"><expr type:"String">_</expr> = <expr type:"String"><expr type:"Int"><expr type:"(Int) -> Int"><expr type:"Int"><expr type:"String"><expr type:"[C]">a</expr>.description</expr>.count</expr>.<expr type:"(Int) -> (Int) -> Int">advanced</expr></expr>(by: <expr type:"Int">1</expr>)</expr>.description</expr></expr> |
9 |
| -// CHECK-SUGAR: <expr type:"()"><expr type:"Int?">_</expr> = <expr type:"Int?"><expr type:"Int"><expr type:"(Int) -> Int"><expr type:"Int"><expr type:"S"><expr type:"S?"><expr type:"[Int : S]">a</expr>[<expr type:"Int">2</expr>]</expr>?</expr>.val</expr>.<expr type:"(Int) -> (Int) -> Int">advanced</expr></expr>(by: <expr type:"Int">1</expr>)</expr>.byteSwapped</expr></expr> |
| 4 | +// CHECK-SUGAR: func foo() -> Int { return <expr type:"Int", qualified:"Swift.Int">1</expr> } |
| 5 | +// CHECK-SUGAR: func bar(f: Float) -> Float { return <expr type:"Float", qualified:"Swift.Float"><expr type:"(Float) -> Float", qualified:"(Swift.Float) -> Swift.Float">bar</expr>(f: <expr type:"Float", qualified:"Swift.Float">1</expr>)</expr> } |
| 6 | +// CHECK-SUGAR: func fooP(_ p: P) { <expr type:"()", qualified:"()"><expr type:"(P) -> ()", qualified:"(swift_ide_test.P) -> ()">fooP</expr>(<expr type:"P", qualified:"swift_ide_test.P">p</expr>)</expr> } |
| 7 | +// CHECK-SUGAR: <expr type:"()", qualified:"()"><expr type:"Int", qualified:"Swift.Int">_</expr> = <expr type:"Int", qualified:"Swift.Int"><expr type:"[C]", qualified:"[swift_ide_test.C]">a</expr>.count</expr></expr> |
| 8 | +// CHECK-SUGAR: <expr type:"()", qualified:"()"><expr type:"String", qualified:"Swift.String">_</expr> = <expr type:"String", qualified:"Swift.String"><expr type:"Int", qualified:"Swift.Int"><expr type:"(Int) -> Int", qualified:"(Swift.Int) -> Swift.Int"><expr type:"Int", qualified:"Swift.Int"><expr type:"String", qualified:"Swift.String"><expr type:"[C]", qualified:"[swift_ide_test.C]">a</expr>.description</expr>.count</expr>.<expr type:"(Int) -> (Int) -> Int", qualified:"(Swift.Int) -> (Swift.Int) -> Swift.Int">advanced</expr></expr>(by: <expr type:"Int", qualified:"Swift.Int">1</expr>)</expr>.description</expr></expr> |
| 9 | +// CHECK-SUGAR: <expr type:"()", qualified:"()"><expr type:"Int?", qualified:"Swift.Int?">_</expr> = <expr type:"Int?", qualified:"Swift.Int?"><expr type:"Int", qualified:"Swift.Int"><expr type:"(Int) -> Int", qualified:"(Swift.Int) -> Swift.Int"><expr type:"Int", qualified:"Swift.Int"><expr type:"S", qualified:"swift_ide_test.S"><expr type:"S?", qualified:"swift_ide_test.S?"><expr type:"[Int : S]", qualified:"[Swift.Int : swift_ide_test.S]">a</expr>[<expr type:"Int", qualified:"Swift.Int">2</expr>]</expr>?</expr>.val</expr>.<expr type:"(Int) -> (Int) -> Int", qualified:"(Swift.Int) -> (Swift.Int) -> Swift.Int">advanced</expr></expr>(by: <expr type:"Int", qualified:"Swift.Int">1</expr>)</expr>.byteSwapped</expr></expr> |
10 | 10 |
|
11 | 11 |
|
12 |
| -// CHECK-SUGAR: return <expr type:"MyInt"><expr type:"MyInt">a</expr> <expr type:"(Int, Int) -> Int">+</expr> <expr type:"MyInt">b</expr></expr> |
13 |
| -// CHECK-CANON: return <expr type:"Int"><expr type:"Int">a</expr> <expr type:"(Int, Int) -> Int">+</expr> <expr type:"Int">b</expr></expr> |
| 12 | +// CHECK-SUGAR: return <expr type:"MyInt", qualified:"swift_ide_test.MyInt"><expr type:"MyInt", qualified:"swift_ide_test.MyInt">a</expr> <expr type:"(Int, Int) -> Int", qualified:"(Swift.Int, Swift.Int) -> Swift.Int">+</expr> <expr type:"MyInt", qualified:"swift_ide_test.MyInt">b</expr></expr> |
| 13 | +// CHECK-CANON: return <expr type:"Int", qualified:"Swift.Int"><expr type:"Int", qualified:"Swift.Int">a</expr> <expr type:"(Int, Int) -> Int", qualified:"(Swift.Int, Swift.Int) -> Swift.Int">+</expr> <expr type:"Int", qualified:"Swift.Int">b</expr></expr> |
0 commit comments