Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swiftの型推論を学ぼう | Let's Learn About Type Inference in Swift

Swiftの型推論を学ぼう | Let's Learn About Type Inference in Swift

try! Swift Tokyo 2024 で発表しました。

スクリプトはこちら
https://speakerdeck.com/omochi/sukuriputo-swiftnoxing-tui-lun-woxue-bou

omochimetaru

March 23, 2024
Tweet

More Decks by omochimetaru

Other Decks in Programming

Transcript

  1. "MHPSJUIN8 w "WPJEJOHGPSNBMEJTDVTTJPOT *XJMMCSJF fl ZFYQMBJOUIF fl PXPG PQFSBUJPOT w

    ⚠1MFBTFGPSHFUBCPVUlJNQMJDJUUZQFJOGFSFODFzGPSBNPNFOU
  2. &YBNQMFPG"45 func id<X>(_ x: X) -> X func main(i: Int)

    { let a = id(i) } WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ
  3. &YBNQMFPG"45 func id<X>(_ x: X) -> X func main(i: Int)

    { let a = id(i) } WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ
  4. &YBNQMFPG"45 func id<X>(_ x: X) -> X func main(i: Int)

    { let a = id(i) } WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ
  5. &YBNQMFPG"45 func id<X>(_ x: X) -> X func main(i: Int)

    { let a = id(i) } WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ
  6. &YBNQMFPG"45 func id<X>(_ x: X) -> X func main(i: Int)

    { let a = id(i) } WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ
  7. &YBNQMFPG"45 func id<X>(_ x: X) -> X func main(i: Int)

    { let a = id(i) } WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ
  8. &YBNQMFPG#JOEJOH5ZQF7BSJBCMFT WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ $T1 $T2 ($T3) -> $T3

    Int <X> (X) -> X func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  9. &YBNQMFPG#JOEJOH5ZQF7BSJBCMFT WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ $T1 $T2 ($T3) -> $T3

    Int <X> (X) -> X func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  10. &YBNQMFPG#JOEJOH5ZQF7BSJBCMFT WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ $T1 $T2 ($T3) -> $T3

    Int <X> (X) -> X func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  11. &YBNQMFPG#JOEJOH5ZQF7BSJBCMFT WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ $T1 $T2 ($T3) -> $T3

    Int <X> (X) -> X func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  12. &YBNQMFPG#JOEJOH5ZQF7BSJBCMFT WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ $T1 $T2 ($T3) -> $T3

    Int <X> (X) -> X func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  13. &YBNQMFPG#JOEJOH5ZQF7BSJBCMFT WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ $T1 $T2 ($T3) -> $T3

    Int <X> (X) -> X func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  14. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  15. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  16. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  17. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  18. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  19. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  20. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  21. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  22. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  23. 6OJGJDBUJPO w 'JOEFRVBMDPOTUSBJOUTGPSUZQFWBSJBCMFTBOESFQMBDFBMMUIFJSPDDVSSFODFT eq($T1, Int) eq($T2, ($T1) -> $T1) eq($T3,

    ($T1) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> $T2) eq($T1, Int) eq($T2, (Int) -> Int) eq($T3, (Int) -> (Int) -> Int)
  24. 4JNQMJGJDBUJPOPGFRVBMDPOTUSBJOUT eq(A?, B?) eq(A, B) 0QUJPOBMT eq((A) -> B, (C)

    -> D) eq(B, D) eq(A, C) 'VODUJPOT eq((A, B), (C, D)) eq(B, D) eq(A, C) 5VQMFT
  25. 4JNQMJGJDBUJPOPGFRVBMDPOTUSBJOUT eq(A?, B?) eq(A, B) 0QUJPOBMT eq((A) -> B, (C)

    -> D) eq(B, D) eq(A, C) 'VODUJPOT eq((A, B), (C, D)) eq(B, D) eq(A, C) 5VQMFT
  26. 4JNQMJGJDBUJPOPGFRVBMDPOTUSBJOUT eq(A?, B?) eq(A, B) 0QUJPOBMT eq((A) -> B, (C)

    -> D) eq(B, D) eq(A, C) 'VODUJPOT eq((A, B), (C, D)) eq(B, D) eq(A, C) 5VQMFT
  27. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  28. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  29. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  30. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  31. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  32. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  33. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  34. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  35. 5IFJOUFSQMBZCFUXFFOVOJGJDBUJPOBOETJNQMJGJDBUJPO call($T1, $T2, $T3) eq($T1, (Int) -> Bool) call((Int) ->

    Bool, $T2, $T3) eq($T1, (Int) -> Bool) eq(Int, $T2) eq($T1, (Int) -> Bool) eq(Bool, $T3)
  36. &YBNQMFPG*OGFSFODF 1SPCMFN4UBUFNFOU func id<X>(_ x: X) -> X func main(i:

    Int) { let a = id(i) } WBSEFDMB DBMM EFDMSFGJE EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int eq($T1, $T2) call(($T3) -> $T3, Int, $T2)
  37. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  38. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  39. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  40. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  41. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  42. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  43. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  44. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  45. &YBNQMFPG*OGFSFODF eq($T1, $T2) call(($T3) -> $T3, Int, $T2) eq($T1, $T2)

    eq($T3, Int) eq($T3, $T2) eq($T1, $T2) eq($T3, Int) eq(Int, $T2) eq($T1, Int) eq($T3, Int) eq(Int, $T2)
  46. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  47. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  48. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  49. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  50. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  51. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  52. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  53. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  54. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  55. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  56. eq($T3, Int) 7FSJGJDBUJPOPG*OGFSFODF3FTVMUT eq($T1, Int) eq(Int, $T2) WBSEFDMB DBMM EFDMSFGJE

    EFDMSFGJ $T1 $T2 ($T3) -> $T3 Int Int Int (Int) -> Int func id<X>(_ x: X) -> X func main(i: Int) { let a = id(i) }
  57. #JEJSFDUJPOBMJUZ func readInt() -> Int func read<X>() -> X func

    main() { let a = readInt() let b: Int = read() } eq($T1, $T2) eq(Int, $T3) call(() -> $T4, $T4, $T3) call(() -> Int, (), $T2)
  58. #JEJSFDUJPOBMJUZ func readInt() -> Int func read<X>() -> X func

    main() { let a = readInt() let b: Int = read() } eq($T1, $T2) eq(Int, $T3) call(() -> $T4, $T4, $T3) call(() -> Int, (), $T2)
  59. #JEJSFDUJPOBMJUZ func readInt() -> Int func read<X>() -> X func

    main() { let a = readInt() let b: Int = read() } eq($T1, $T2) eq(Int, $T3) call(() -> $T4, $T4, $T3) call(() -> Int, (), $T2)
  60. #JEJSFDUJPOBMJUZ func readInt() -> Int func read<X>() -> X func

    main() { let a = readInt() let b: Int = read() } eq($T1, $T2) eq(Int, $T3) call(() -> $T4, $T4, $T3) call(() -> Int, (), $T2)
  61. 4JNQMJGJDBUJPOPG$POWFSTJPO$POTUSBJOUT conv((A) -> B, (C) -> D) conv(B, D) conv(C,

    A) 1BSBNFUFST 🙃DPOUSBWBSJBODF 3FUVSOWBMVFT 🙂DPWBSJBODF
  62. 1SPCMFNPG$POWFSTJPO$POTUSBJOUT func main(i: Int) { let a = i }

    conv(Int, $T1) 🤷 eq($T1, Int) eq($T1, Int?) eq($T1, Any) 0, 0, 0,
  63. 4UBSU 5*OU 5*OU 5*OU 5*OU conv($T1, Int?) conv(Int?, $T2) eq($T1,

    $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, $T2) eq(Int, $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, Int) eq(Int, $T2) eq($T1, Int)
  64. 4UBSU 5*OU 5*OU 5*OU 5*OU conv($T1, Int?) conv(Int?, $T2) eq($T1,

    $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, $T2) eq(Int, $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, Int) eq(Int, $T2) eq($T1, Int)
  65. 4UBSU 5*OU 5*OU 5*OU 5*OU conv($T1, Int?) conv(Int?, $T2) eq($T1,

    $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, $T2) eq(Int, $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, Int) eq(Int, $T2) eq($T1, Int)
  66. 4UBSU 5*OU 5*OU 5*OU 5*OU conv($T1, Int?) conv(Int?, $T2) eq($T1,

    $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, $T2) eq(Int, $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, Int) eq(Int, $T2) eq($T1, Int)
  67. 4UBSU 5*OU 5*OU 5*OU 5*OU conv($T1, Int?) conv(Int?, $T2) eq($T1,

    $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, $T2) eq(Int, $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, Int) eq(Int, $T2) eq($T1, Int)
  68. 4UBSU 5*OU 5*OU 5*OU 5*OU conv($T1, Int?) conv(Int?, $T2) eq($T1,

    $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, $T2) eq(Int, $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, Int) eq(Int, $T2) eq($T1, Int)
  69. 4UBSU 5*OU 5*OU 5*OU 5*OU conv($T1, Int?) conv(Int?, $T2) eq($T1,

    $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, $T2) eq(Int, $T2) eq($T1, Int) conv(Int, Int?) conv(Int?, Int) eq(Int, $T2) eq($T1, Int)
  70. 4UBSU 5*OU 5*OU 5*OU 5*OU ❌ eq($T1, Int?) conv(Int?, $T2)

    eq($T1, $T2) conv(Int, $T1) eq($T1, Int?) conv(Int?, $T2) eq(Int?, $T2) conv(Int, Int?) eq($T1, Int?) conv(Int?, Int?) eq(Int?, $T2) conv(Int, Int?)
  71. 4UBSU 5*OU 5*OU 5*OU 5*OU ❌ eq($T1, Int?) conv(Int?, $T2)

    eq($T1, $T2) conv(Int, $T1) eq($T1, Int?) conv(Int?, $T2) eq(Int?, $T2) conv(Int, Int?) eq($T1, Int?) conv(Int?, Int?) eq(Int?, $T2) conv(Int, Int?)
  72. 4UBSU 5*OU 5*OU 5*OU 5*OU ❌ eq($T1, Int?) conv(Int?, $T2)

    eq($T1, $T2) conv(Int, $T1) eq($T1, Int?) conv(Int?, $T2) eq(Int?, $T2) conv(Int, Int?) eq($T1, Int?) conv(Int?, Int?) eq(Int?, $T2) conv(Int, Int?)
  73. 4UBSU 5*OU 5*OU 5*OU 5*OU ❌ eq($T1, Int?) conv(Int?, $T2)

    eq($T1, $T2) conv(Int, $T1) eq($T1, Int?) conv(Int?, $T2) eq(Int?, $T2) conv(Int, Int?) eq($T1, Int?) conv(Int?, Int?) eq(Int?, $T2) conv(Int, Int?)
  74. 4UBSU 5*OU 5*OU 5*OU 5*OU ❌ eq($T1, Int?) conv(Int?, $T2)

    eq($T1, $T2) conv(Int, $T1) eq($T1, Int?) conv(Int?, $T2) eq(Int?, $T2) conv(Int, Int?) eq($T1, Int?) conv(Int?, Int?) eq(Int?, $T2) conv(Int, Int?)
  75. 4UBSU 5*OU 5*OU 5*OU 5*OU ❌ eq($T1, Int?) conv(Int?, $T2)

    eq($T1, $T2) conv(Int, $T1) eq($T1, Int?) conv(Int?, $T2) eq(Int?, $T2) conv(Int, Int?) eq($T1, Int?) conv(Int?, Int?) eq(Int?, $T2) conv(Int, Int?)
  76. 4UBSU 5*OU 5*OU 5*OU 5*OU ❌ eq($T1, Int?) conv(Int?, $T2)

    eq($T1, $T2) conv(Int, $T1) eq($T1, Int?) conv(Int?, $T2) eq(Int?, $T2) conv(Int, Int?) eq($T1, Int?) conv(Int?, Int?) eq(Int?, $T2) conv(Int, Int?)
  77. )BOEMJOH0WFSMPBET func foo() -> Bool func foo() -> Int func

    foo() -> String func main(i: Int) { let a: Int = foo() } call($T1, (), Int) eq($T1, () -> Bool) eq($T1, () -> Int) eq($T1, () -> String) QPTTJCJMFY
  78. )BOEMJOH0WFSMPBET func foo() -> Bool func foo() -> Int func

    foo() -> String func main(i: Int) { let a: Int = foo() } call($T1, (), Int) eq($T1, () -> Bool) eq($T1, () -> Int) eq($T1, () -> String) QPTTJCJMFY
  79. )BOEMJOH0WFSMPBET func foo() -> Bool func foo() -> Int func

    foo() -> String func main(i: Int) { let a: Int = foo() } call($T1, (), Int) eq($T1, () -> Bool) eq($T1, () -> Int) eq($T1, () -> String) QPTTJCJMFY
  80. )BOEMJOH0WFSMPBET func foo() -> Bool func foo() -> Int func

    foo() -> String func main(i: Int) { let a: Int = foo() } call($T1, (), Int) eq($T1, () -> Bool) eq($T1, () -> Int) eq($T1, () -> String) QPTTJCJMFY
  81. "UUFNQUTBOE$PNQVUBUJPOBM$PNQMFYJUZ w 5IFNFDIBOJTNPGlBUUFNQUDBOEJEBUFTzIBTUIFQPUFOUJBMUPFYQMPEF JODPNQVUBUJPOBMDPNQMFYJUZ 💣 code.swift:11:9: error: the compiler is

    unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
  82. .BLJOHUIF$PNQJMFS0VUQVUUIF0QFSBUJPOTPG5ZQF*OGFSFODF $ swiftc -Xfrontend -debug-constraints code.swift func foo() -> Int

    { 0 } func foo() -> Bool { true } func main() { let a: Int = foo() } 0VUQVUFYDFFEJOHMJOFT🤯
  83. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  84. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  85. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  86. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  87. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  88. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  89. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  90. *OGFSFODFQSPDFTT func foo() -> Int { 0 } func foo()

    -> Bool { true } func main() { let a: Int = foo() } 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  91. $ swiftc -Xfrontend -debug-constraints code.swift ---Constraint solving at [code.swift:1:21 -

    line:1:21]--- (…) ---Constraint solving at [code.swift:2:22 - line:2:22]--- (…) ---Constraint solving at [code.swift:5:9 - line:5:22]--- (…) func foo() -> Int { 0 } func foo() -> Bool { true } func main() { let a: Int = foo() } 0VUQVUGPSUIF&OUJSF$PEF
  92. $ swiftc -Xfrontend -debug-constraints code.swift ---Constraint solving at [code.swift:1:21 -

    line:1:21]--- (…) ---Constraint solving at [code.swift:2:22 - line:2:22]--- (…) ---Constraint solving at [code.swift:5:9 - line:5:22]--- (…) func foo() -> Int { 0 } func foo() -> Bool { true } func main() { let a: Int = foo() } 0VUQVUGPSUIF&OUJSF$PEF
  93. $ swiftc -Xfrontend -debug-constraints code.swift ---Constraint solving at [code.swift:1:21 -

    line:1:21]--- (…) ---Constraint solving at [code.swift:2:22 - line:2:22]--- (…) ---Constraint solving at [code.swift:5:9 - line:5:22]--- (…) func foo() -> Int { 0 } func foo() -> Bool { true } func main() { let a: Int = foo() } 0VUQVUGPSUIF&OUJSF$PEF
  94. $ swiftc -Xfrontend -debug-constraints code.swift ---Constraint solving at [code.swift:1:21 -

    line:1:21]--- (…) ---Constraint solving at [code.swift:2:22 - line:2:22]--- (…) ---Constraint solving at [code.swift:5:9 - line:5:22]--- (…) func foo() -> Int { 0 } func foo() -> Bool { true } func main() { let a: Int = foo() } 0VUQVUGPSUIF&OUJSF$PEF
  95. 0VUQVUGPS*OEJWJEVBM*OGFSFODFT ---Constraint solving at [code.swift:5:9 - line:5:22]--- ---Initial constraints for

    the given expression--- (Initial State of the AST) (Initial State of the Constraints) (Inference Process) ---Solution--- (Solution) ---Type-checked expression--- (Typed AST)
  96. *OJUJBM4UBUFPGUIF"45 ---Initial constraints for the given expression— (call_expr type='$T1' location=code.swift:5:18

    range=[code.swift:5:18 - line:5:22] isolationCrossing=none (overloaded_decl_ref_expr type='$T0' location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] name=foo number_of_decls=2 function_ref=single decls=[ code.(file).foo()@code.swift:1:6, code.(file).foo()@code.swift:2:6]) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE $T0 $T1
  97. *OJUJBM4UBUFPGUIF"45 ---Initial constraints for the given expression— (call_expr type='$T1' location=code.swift:5:18

    range=[code.swift:5:18 - line:5:22] isolationCrossing=none (overloaded_decl_ref_expr type='$T0' location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] name=foo number_of_decls=2 function_ref=single decls=[ code.(file).foo()@code.swift:1:6, code.(file).foo()@code.swift:2:6]) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE $T0 $T1
  98. *OJUJBM4UBUFPGUIF"45 ---Initial constraints for the given expression— (call_expr type='$T1' location=code.swift:5:18

    range=[code.swift:5:18 - line:5:22] isolationCrossing=none (overloaded_decl_ref_expr type='$T0' location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] name=foo number_of_decls=2 function_ref=single decls=[ code.(file).foo()@code.swift:1:6, code.(file).foo()@code.swift:2:6]) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE $T0 $T1
  99. *OJUJBM4UBUFPGUIF"45 ---Initial constraints for the given expression— (call_expr type='$T1' location=code.swift:5:18

    range=[code.swift:5:18 - line:5:22] isolationCrossing=none (overloaded_decl_ref_expr type='$T0' location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] name=foo number_of_decls=2 function_ref=single decls=[ code.(file).foo()@code.swift:1:6, code.(file).foo()@code.swift:2:6]) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE $T0 $T1
  100. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  101. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  102. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  103. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  104. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  105. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  106. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  107. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  108. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  109. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  110. *OJUJBM4UBUFPGUIF$POTUSBJOUT Score: <default 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0> Contextual Type: Int at [code.swift:5:12 - line:5:12] Type Variables: $T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings: <empty>] @ locator@0x11b81ac00 [[email protected]:5:18] $T1 [allows bindings to: noescape] [attributes: delayed] [with possible bindings: (subtypes of) Int] @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Inactive Constraints: disjunction @ locator@0x11b81ac00 [[email protected]:5:18]: > $T0 bound to decl code.(file).foo()@code.swift:1:6 : () -> Int > $T0 bound to decl code.(file).foo()@code.swift:2:6 : () -> Bool () -> $T1 applicable fn $T0 @ locator@0x11b81ae30 [[email protected]:5:18 → apply function] $T1 conv Int @ locator@0x11b81aec8 [[email protected]:5:18 → contextual type]
  111. *OGFSFODF1SPDFTT (attempting type variable binding $T1 := Int ... (attempting

    disjunction choice $T0 bound to decl code. (file).foo()@code.swift:1:6 : () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] ... (found solution: <default 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>) ) (attempting disjunction choice $T0 bound to decl code. (file).foo()@code.swift:2:6 : () -> Bool @ locator@0x11b81ac00 [[email protected]:5:18] ... (outcome: error) ) ) 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  112. *OGFSFODF1SPDFTT (attempting type variable binding $T1 := Int ... (attempting

    disjunction choice $T0 bound to decl code. (file).foo()@code.swift:1:6 : () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] ... (found solution: <default 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>) ) (attempting disjunction choice $T0 bound to decl code. (file).foo()@code.swift:2:6 : () -> Bool @ locator@0x11b81ac00 [[email protected]:5:18] ... (outcome: error) ) ) 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  113. *OGFSFODF1SPDFTT (attempting type variable binding $T1 := Int ... (attempting

    disjunction choice $T0 bound to decl code. (file).foo()@code.swift:1:6 : () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] ... (found solution: <default 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>) ) (attempting disjunction choice $T0 bound to decl code. (file).foo()@code.swift:2:6 : () -> Bool @ locator@0x11b81ac00 [[email protected]:5:18] ... (outcome: error) ) ) 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  114. *OGFSFODF1SPDFTT (attempting type variable binding $T1 := Int ... (attempting

    disjunction choice $T0 bound to decl code. (file).foo()@code.swift:1:6 : () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] ... (found solution: <default 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>) ) (attempting disjunction choice $T0 bound to decl code. (file).foo()@code.swift:2:6 : () -> Bool @ locator@0x11b81ac00 [[email protected]:5:18] ... (outcome: error) ) ) 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  115. *OGFSFODF1SPDFTT (attempting type variable binding $T1 := Int ... (attempting

    disjunction choice $T0 bound to decl code. (file).foo()@code.swift:1:6 : () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] ... (found solution: <default 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>) ) (attempting disjunction choice $T0 bound to decl code. (file).foo()@code.swift:2:6 : () -> Bool @ locator@0x11b81ac00 [[email protected]:5:18] ... (outcome: error) ) ) 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  116. *OGFSFODF1SPDFTT (attempting type variable binding $T1 := Int ... (attempting

    disjunction choice $T0 bound to decl code. (file).foo()@code.swift:1:6 : () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] ... (found solution: <default 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>) ) (attempting disjunction choice $T0 bound to decl code. (file).foo()@code.swift:2:6 : () -> Bool @ locator@0x11b81ac00 [[email protected]:5:18] ... (outcome: error) ) ) 4UBSU 5*OU 5 *OU 5 #PPM 4VDDFTT 'BJMVSF
  117. 4PMVUJPO ---Solution--- Fixed score: <default 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0> Type variables: $T0 as () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] $T1 as Int @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Overload choices: locator@0x11b81ac00 [[email protected]:5:18] with code. (file).foo()@code.swift:1:6 as foo: () -> Int Trailing closure matching: locator@0x11b81afe8 [[email protected]:5:18 → apply argument]: forward
  118. 4PMVUJPO ---Solution--- Fixed score: <default 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0> Type variables: $T0 as () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] $T1 as Int @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Overload choices: locator@0x11b81ac00 [[email protected]:5:18] with code. (file).foo()@code.swift:1:6 as foo: () -> Int Trailing closure matching: locator@0x11b81afe8 [[email protected]:5:18 → apply argument]: forward
  119. 4PMVUJPO ---Solution--- Fixed score: <default 0 0 0 0 0

    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0> Type variables: $T0 as () -> Int @ locator@0x11b81ac00 [[email protected]:5:18] $T1 as Int @ locator@0x11b81adb0 [[email protected]:5:18 → function result] $T2 as Int @ locator@0x11b81aef0 [[email protected]:5:18 → contextual type → pattern match → pattern match → named pattern decl] Overload choices: locator@0x11b81ac00 [[email protected]:5:18] with code. (file).foo()@code.swift:1:6 as foo: () -> Int Trailing closure matching: locator@0x11b81afe8 [[email protected]:5:18 → apply argument]: forward
  120. 5ZQFE"45 ---Type-checked expression--- (call_expr type=‘Int' location=code.swift:5:18 range=[code.swift:5:18 - line:5:22] isolationCrossing=none

    (declref_expr type='() -> Int’ location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] decl=code.(file).foo()@code.swift:1:6 function_ref=single) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE () -> Int Int
  121. 5ZQFE"45 ---Type-checked expression--- (call_expr type=‘Int' location=code.swift:5:18 range=[code.swift:5:18 - line:5:22] isolationCrossing=none

    (declref_expr type='() -> Int’ location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] decl=code.(file).foo()@code.swift:1:6 function_ref=single) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE () -> Int Int
  122. 5ZQFE"45 ---Type-checked expression--- (call_expr type=‘Int' location=code.swift:5:18 range=[code.swift:5:18 - line:5:22] isolationCrossing=none

    (declref_expr type='() -> Int’ location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] decl=code.(file).foo()@code.swift:1:6 function_ref=single) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE () -> Int Int
  123. 5ZQFE"45 ---Type-checked expression--- (call_expr type=‘Int' location=code.swift:5:18 range=[code.swift:5:18 - line:5:22] isolationCrossing=none

    (declref_expr type='() -> Int’ location=code.swift:5:18 range=[code.swift:5:18 - line:5:18] decl=code.(file).foo()@code.swift:1:6 function_ref=single) (argument_list)) let a: Int = foo() DBMM EFDMSFGJE () -> Int Int