Skip to content

Commit a8904ec

Browse files
committed
workflows: go1.23
1 parent 0ac84b9 commit a8904ec

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
Test:
1111
strategy:
1212
matrix:
13-
go-version: [1.19.x, 1.21.x, 1.22.x]
13+
go-version: [1.19.x, 1.21.x, 1.22.x, 1.23.x]
1414
os: [ubuntu-latest, windows-latest, macos-latest]
1515
runs-on: ${{ matrix.os }}
1616
steps:

typesinfer_go123.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package gogen
55

66
import (
77
"fmt"
8+
"go/token"
89
"go/types"
910
_ "unsafe"
1011
)
@@ -42,12 +43,12 @@ type error_ struct {
4243
//go:linkname checker_infer123 go/types.(*Checker).infer
4344
func checker_infer123(check *types.Checker, posn positioner, tparams []*types.TypeParam, targs []types.Type, params *Tuple, args []*operand, reverse bool, err *error_) (inferred []types.Type)
4445

45-
func checker_infer(check *types.Checker, posn positioner, tparams []*types.TypeParam, targs []types.Type, params *types.Tuple, args []*operand) (result []types.Type, err error) {
46+
func checker_infer(check *types.Checker, conf *types.Config, fset *token.FileSet, posn positioner, tparams []*types.TypeParam, targs []types.Type, params *types.Tuple, args []*operand) (result []types.Type) {
4647
const CannotInferTypeArgs = 138
47-
_err := &error_{check: check, code: CannotInferTypeArgs}
48-
result = checker_infer123(check, posn, tparams, targs, params, args, true, _err)
49-
if len(_err.desc) > 0 {
50-
err = fmt.Errorf("%s", _err.desc[0].msg)
48+
err := &error_{check: check, code: CannotInferTypeArgs}
49+
result = checker_infer123(check, posn, tparams, targs, params, args, true, err)
50+
for _, d := range err.desc {
51+
conf.Error(types.Error{Fset: fset, Pos: d.posn.Pos(), Msg: d.msg})
5152
}
5253
return
5354
}
@@ -62,6 +63,6 @@ func infer(pkg *Package, posn positioner, tparams []*types.TypeParam, targs []ty
6263
},
6364
}
6465
checker := types.NewChecker(conf, pkg.Fset, pkg.Types, nil)
65-
result, err = checker_infer(checker, posn, tparams, targs, params, args)
66+
result = checker_infer(checker, conf, pkg.Fset, posn, tparams, targs, params, args)
6667
return
6768
}

0 commit comments

Comments
 (0)