mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 19:55:11 +00:00
According to https://docs.carbon-lang.dev/docs/design/generics/details.html#adapting-types: > You can add any declaration that you could add to a class except for declarations that would change the representation of the type. This means you can add methods, functions, interface implementations, and aliases, but not fields, base classes, or virtual functions. The specific implementations of virtual functions are part of the type representation, and so no virtual functions may be overridden in an adapter either. So, let's check/reject that. Checking at the end of the class ensures that no matter the order of methods and adapt statements, the issue will still be correctly diagnosed.