#!stacks
"goPanicIndex" && "fingerprint.unify.func3:+8"

Issue created by stacks.

func unify(x, y sexpr) bool {

    // maxTypeParam returns the maximum type parameter index in x.
    var maxTypeParam func(x sexpr) int
    maxTypeParam = func(x sexpr) int {...}
...
    yBindings := make([]*sexpr, maxTypeParam(y)+1)
    for i := range len(yBindings) {
        yBindings[i] = new(sexpr)
    }

    // bind sets binding b to s from bindings if it does not occur in s.
    bind := func(b *sexpr, s sexpr, bindings []*sexpr) bool {
...
    var uni func(x, y sexpr) bool
    uni = func(x, y sexpr) bool {
        var bx, by *sexpr
        ix := typeParamIndex(x)
        if ix >= 0 {
            bx = xBindings[ix]
        }
        iy := typeParamIndex(y)
        if iy >= 0 {
            by = yBindings[iy] // OOB index panic

This stack FSaUqg was reported by telemetry:

golang.org/x/tools/gopls@v0.20.0 go1.24.6 linux/amd64 vscode (1)

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)