diff --git a/internal/types/resolver.go b/internal/types/resolver.go index 45e41db9..deb83876 100644 --- a/internal/types/resolver.go +++ b/internal/types/resolver.go @@ -601,7 +601,7 @@ func (check *Checker) resolveExprOrTypeOrGenericCall(x *operand, e *ast.CallExpr pname := obj assert(pname.pkg == check.pkg) exp := pname.Imported().scope.Lookup(eCall.Sel.Name) - if fnObj, _ := exp.(*Func); ok && len(fnObj.generic) != 0 { + if fnObj, ok := exp.(*Func); ok && len(fnObj.generic) != 0 { for _, genericFnObj := range fnObj.generic { if err := check.tryGenericCall(x, genericFnObj, e); err == nil { eCall.Sel.Name = genericFnObj.name @@ -613,15 +613,13 @@ func (check *Checker) resolveExprOrTypeOrGenericCall(x *operand, e *ast.CallExpr case *Var: // this.Method(arg) if t, _ := obj.Type().(*Named); t != nil { - if p, _ := t.underlying.(*Pointer); p != nil { - obj, _, _ := lookupFieldOrMethod(p, true, check.pkg, eCall.Sel.Name) - if fnObj, ok := obj.(*Func); ok && len(fnObj.generic) != 0 { - for _, genericFnObj := range fnObj.generic { - if err := check.tryGenericCall(x, genericFnObj, e); err == nil { - eCall.Sel.Name = genericFnObj.name - check.exprOrType(x, e.Fun) - return - } + obj, _, _ := lookupFieldOrMethod(t, true, check.pkg, eCall.Sel.Name) + if fnObj, ok := obj.(*Func); ok && len(fnObj.generic) != 0 { + for _, genericFnObj := range fnObj.generic { + if err := check.tryGenericCall(x, genericFnObj, e); err == nil { + eCall.Sel.Name = genericFnObj.name + check.exprOrType(x, e.Fun) + return } } } diff --git a/waroot/changelog.md b/waroot/changelog.md index 8d824378..580dcae2 100644 --- a/waroot/changelog.md +++ b/waroot/changelog.md @@ -1,7 +1,10 @@ # 版本日志 - (dev) - - 禁止类型别名 +- v0.10.0 (2024-03-29) + - 补充基本类型读写胶水 + - 修正 I64、U64 不应导出等一些错误 + - 实验性引入全局函数和方法的重载功能 - v0.9.2 (2024-03-04) MVP - 完善 `js/p5` 包, 增加键盘事件处理, 改用凹语言原生绘图 - `wa init` 增加 `-p5` 参数