conv.

All stories
TechQuiet 86d · day 87

Go 1.27 adds generic methods to concrete types

Methods can now define their own type parameters, ending a four-year limitation since generics' 2022 introduction.

What to know

  • Go 1.27 enables methods on concrete types to declare their own type parameters, eliminating a design limitation present since generics' 2022 introduction.
  • Generic methods remain excluded from interfaces due to incompatibility between compile-time monomorphization and runtime interface dispatch.
  • The reflect package cannot detect generic methods, making them invisible to interfaces, validators, and ORMs relying on reflection.

“Methods can now define their own type parameters without adding them to the receiving struct.”

Dominik Honnef, Technical author · dominik.info blog

Dominik Honnef Technical authorGo team Language designers

Go 1.27 adds generic methods to concrete types
habr.com

The record 3 articles and posts · last 30 days

  1. Generic Methods in Go 1.27 press · HN Frontpage · EspressoGPT · 86d ago
  2. Generic Methods in Go 1.27 L: https:// dominik.info/blog/go-generic-m ethods C: https:// news.ycombinator.com/item?id=4… post · Mastodon · hkrn@mstdn.social · 86d ago
  3. Go 1.27: generic-методы, которых не видит reflect Go 1.27 (на момент написания rc3, финал обещают в августе) приносит… post · Mastodon · habr@zhub.link · 87d ago

What people are saying 10 voices from 2 sites · verbatim