Closed
Description
This is a follow-up on #50755. The following code:
func f[M map[K]int, K comparable](m M) {
f(m)
}
leads to an internal stack overflow during unification and then type checking fails with error:
M does not match map[K]int
Start of the inference process:
-- inferA [M₁, K₂] -> []
M₁ ≡ M₁
. M₁ ➞ M₁
-- inferB [M₁, K₂] ➞ [M₁, <nil>]
M₁ ➞ M₁
M₁ ≡ map[K₂]int
. M₁ ≡ map[K₂]int
. . M₁ ≡ map[K₂]int
. . . M₁ ≡ map[K₂]int
. . . . M₁ ≡ map[K₂]int
etc.
Marking for 1.18 in case the fix is easy. Ok to move to 1.19.
cc: @findleyr