Avatar
omochimetaru 4/11/2020 5:26 PM
Comparing declarations func f(_ aa: Int) { } and func f(_ aa: Int, _ bb: Int = 0) { } (isDynamicOverloadComparison: 0) comparison result: not better Comparing declarations func f(_ aa: Int, _ bb: Int = 0) { } and func f(_ aa: Int) { } (isDynamicOverloadComparison: 0) comparison result: better comparing solutions 0 and 1
5:27 PM
↑ここだけみると逆に見えちゃうけど
5:27 PM
--- Solution #0 --- locator@0x7fd8578d8e00 [DeclRef@b.swift:15:3] with b.(file).main(a:).a@b.swift:14:11 as a: S --- Solution #1 --- locator@0x7fd8578d8e50 [UnresolvedDot@b.swift:15:5 -> member] with b.(file).P extension.f@b.swift:7:8 as S.f: (Int) -> () Opened types: locator@0x7fd8578d8e50 [UnresolvedDot@b.swift:15:5 -> member] opens τ_0_0 -> $T4
5:27 PM
↑ここからの推測で
5:27 PM
P.f の呼び出しは実際には func f<Self>(self: Self, _ aa: Int) の呼び出しだから (edited)
5:28 PM
「ジェネリックな方が弱い」が効いてるんじゃないかしら