@@ -381,8 +381,8 @@ func (check *Checker) collectObjects() {
381
381
check .declarePkgObj (name , obj , di )
382
382
}
383
383
case typeDecl :
384
- if d .spec .TParams .NumFields () != 0 && ! check .allowVersion (pkg , 1 , 18 ) {
385
- check .softErrorf (d .spec .TParams .List [0 ], _Todo , "type parameters require go1.18 or later" )
384
+ if d .spec .TypeParams .NumFields () != 0 && ! check .allowVersion (pkg , 1 , 18 ) {
385
+ check .softErrorf (d .spec .TypeParams .List [0 ], _Todo , "type parameters require go1.18 or later" )
386
386
}
387
387
obj := NewTypeName (d .spec .Name .Pos (), pkg , d .spec .Name .Name , nil )
388
388
check .declarePkgObj (d .spec .Name , obj , & declInfo {file : fileScope , tdecl : d .spec })
@@ -401,8 +401,8 @@ func (check *Checker) collectObjects() {
401
401
if name == "main" {
402
402
code = _InvalidMainDecl
403
403
}
404
- if d .decl .Type .TParams .NumFields () != 0 {
405
- check .softErrorf (d .decl .Type .TParams .List [0 ], code , "func %s must have no type parameters" , name )
404
+ if d .decl .Type .TypeParams .NumFields () != 0 {
405
+ check .softErrorf (d .decl .Type .TypeParams .List [0 ], code , "func %s must have no type parameters" , name )
406
406
hasTParamError = true
407
407
}
408
408
if t := d .decl .Type ; t .Params .NumFields () != 0 || t .Results != nil {
@@ -439,8 +439,8 @@ func (check *Checker) collectObjects() {
439
439
}
440
440
check .recordDef (d .decl .Name , obj )
441
441
}
442
- if d .decl .Type .TParams .NumFields () != 0 && ! check .allowVersion (pkg , 1 , 18 ) && ! hasTParamError {
443
- check .softErrorf (d .decl .Type .TParams .List [0 ], _Todo , "type parameters require go1.18 or later" )
442
+ if d .decl .Type .TypeParams .NumFields () != 0 && ! check .allowVersion (pkg , 1 , 18 ) && ! hasTParamError {
443
+ check .softErrorf (d .decl .Type .TypeParams .List [0 ], _Todo , "type parameters require go1.18 or later" )
444
444
}
445
445
info := & declInfo {file : fileScope , fdecl : d .decl }
446
446
// Methods are not package-level objects but we still track them in the
0 commit comments