Tags: Progate/yaegi
Tags
fix: avoid memory leak in closure Simplify frame management. Remove node dependency on frame pointer. Fixes traefik#1618
interp: correctly init variables assigned from function call In the case of a Go short definition (i.e. `a, b := f()`), the new defined variables must be (re-)created in order to preserve the previous value (if in a loop) which can be still in use in the context of a closure. This must not apply to redeclared variables which simply see their value reassigned. The problem was both occuring in callBin() for runtime functions and assignFromCall() for functions created in the interpreter. Fixes traefik#1497.
interp: wrap source functions when used as input parameters. It allows to use interpreter functions as parameters in the runtime, even for defered callbacks, or when passed as empty interfaces, as for runtime.SetFinalizer. Fixes traefik#1503
interp: fix generic check on nil function Related to issue traefik/traefik#9231
interp: add support of Go generics in interpreter Status: * [x] parsing code with generics * [x] instantiate generics from concrete types * [x] automatic type inference * [x] support of generic recursive types * [x] support of generic methods * [x] support of generic receivers in methods * [x] support of multiple type parameters * [x] support of generic constraints * [x] tests (see _test/gen*.go) Fixes traefik#1363.
interp: fix resolution of methods on aliased types The type.val field was always pointing to the final underlying type for aliased types, defeating a possible match if a method was attached to a type in between. Now the complete chain of aliases is always preserved. We have added an underlying() itype method which returns the underlying type of a defined type (aliasT), even in the presence of multiple indirections. We have added a definedType function which checks if type t1 is defined from type t2 or t2 defined from t1, required when checking assignability of aliasT types. Fixes traefik#1411. PS: this is the 2nd attempt, as the first version traefik#1412 wasn't passing _test/issue-1408.go as well. This PR does pass and supersedes traefik#1412.
interp: improve handling values and comparisons in interfaces Fixes traefik#1347.
PreviousNext