mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
1e3baff966
hasMethodSet was computed from the raw, unfiltered method set length (ms.Len() != 0), before generic methods were excluded from numMethods and the method set value. For a type whose only method is generic (e.g. "func (t T) M[X int](n X) X"), this left hasMethodSet true even though the actual (filtered) method set is empty, causing an unnecessary empty method-set global and methodSet field to be emitted for that type's type descriptor. Compute hasMethodSet from the same filtered loop that produces numMethods, so it's true only when at least one non-generic method exists.