!·ͨɺGPPͷࢀরʹରԠ͢ΔɺPWFSMPBEFE@EFDM@SFG@FYQSϊʔυ͕͋Γ·
͢ɻ
͜ͷࣜͷܕ5ͱ͍͏ܕมʹׂΓͯΒΕ͍ͯΔ͜ͱ͕Θ͔Γ·͢ɻ
*OJUJBM4UBUFPGUIF$POTUSBJOUT
Score:
Contextual Type: Int at [code.swift:5:12 - line:5:12]
Type Variables:
$T0 [allows bindings to: lvalue, noescape] [attributes: delayed] [with possible bindings:
] @ 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]
੍ͷॳظঢ়ଶΛݟ͍͖ͯ·͠ΐ͏ɻ
ͨ͘͞Μͷใ͕͋ΔͷͰɺॏཁͳͱ͜ΖΛൈਮ͠·͢ɻ
!·ͣɺ$POUFYUVBM5ZQFͰ͢ɻ
͜Εࠓղ͜͏ͱ͍ͯ͠Δࣜʹ͔͔͍ͬͯΔࠨลͷܕͰ͢ɻ
ࠓճͷίʔυͰɺࠨลͷมʹ*OU͕ܕࢦఆ͞Ε͍ͯΔͷͰɺͦͷใ͕දࣔ
͞Ε͍ͯ·͢ɻ
!࣍ʹɺ5ZQF7BSJBCMFTͰ͢ɻ
͜ͷηΫγϣϯʹɺܕมͷҰཡ͕දࣔ͞Ε·͢ɻ
!ઌ΄Ͳ"45ʹׂΓͯΒΕ͍ͯͨɺ5ͱ5͕දࣔ͞Ε͍ͯ·͢ɻ
!·ͨɺઌ΄Ͳઆ໌ͨ͠$POUFYUVBM5ZQF͕5ͱͯ͠දࣔ͞Ε͍ͯ·͢ɻ
͜Εطʹܕ͕*OUʹ֬ఆͨ͠ঢ়ଶͰ͢ɻ
!࣍ʹɺ*OBDUJWF$POTUSBJOUTͰ͢ɻ
͜Ε੍͕ͷू߹ͷ͜ͱͰ͢ɻ