Feedback
Invalid extension method containers reached runtime instead of compiler diagnostic
- Status
- Fixed
- Fixed in
- v26.5.6
- Source discussion
- https://forum.objo.dev/d/116-extension-method-requirements-not-clear
- Last updated
- 2026-05-24
Public summary
Declaring an extension method outside a module produced a confusing runtime failure instead of a compile-time diagnostic. For example, an extension method added to a class could compile far enough to fail at runtime with Only instances have methods.
Expected behaviour: extension methods declared outside a module should be rejected during compilation with a clear diagnostic.