SR-7380, Ambiguous KeyPath
Here’s the bug I fixed (with a lot of help):
7380.swift:1:16: error: type of expression is ambiguous without more context "str"[keyPath: \.count] ^~~~~~~That seems obviously broken. The value is a
String
literal. TheyKeyPath
should obviously beString.count
. So why doesn’t this work?
This is an interesting look at learning how to fix a bug in the Swift compiler.