3 ms·
The design does not require a specific implementation strategy (monomorphization, boxing or other approaches are possible). It can change from Go implementation
by mseepgood 5y ago
The design does not require a specific implementation strategy (monomorphization, boxing or other approaches are possible). It can change from Go implementation to Go implementation and from Go version to Go version.
- jerf 5y agoIt works the other way too; the implementation is not obligated to pass an interface value to a function. The interface can be monomorphized too, if the compiler saw fit, and it would be a compliant implementation. At the language level, it's a useless use of generics. Even if generics someday used a monomorphic implementation, the compiler would be able to translate those two things back and forth trivially.