File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ type IllTypedError struct {
15
15
}
16
16
17
17
func (e * IllTypedError ) Error () string {
18
- return fmt .Sprintf ("errors in package: %v" , e .Pkg .Errors )
18
+ return fmt .Sprintf ("IllTypedError: errors in package: %v" , e .Pkg .Errors )
19
19
}
20
20
21
21
func BuildIssuesFromIllTypedError (errs []error , lintCtx * linter.Context ) ([]result.Issue , error ) {
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ import (
24
24
25
25
const unsafePkgName = "unsafe"
26
26
27
+ // https://github.com/golang/go/blob/go1.23.8/src/internal/types/errors/codes.go#L1484
28
+ const tooNew = 151
29
+
27
30
type loadingPackage struct {
28
31
pkg * packages.Package
29
32
imports map [string ]* loadingPackage
@@ -436,6 +439,14 @@ func (lp *loadingPackage) convertError(err error) []packages.Error {
436
439
437
440
case types.Error :
438
441
// from type checker
442
+
443
+ // https://github.com/golang/go/blob/go1.23.8/src/go/types/api.go#L52-L57
444
+ if int (reflect .ValueOf (err ).FieldByName ("go116code" ).Int ()) == tooNew {
445
+ // https://github.com/golang/go/blob/go1.23.8/src/go/types/check.go#L380
446
+ // https://github.com/golang/go/blob/go1.23.8/src/go/types/check.go#L349
447
+ panic (err .Msg )
448
+ }
449
+
439
450
errs = append (errs , packages.Error {
440
451
Pos : err .Fset .Position (err .Pos ).String (),
441
452
Msg : err .Msg ,
You can’t perform that action at this time.
0 commit comments