You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Static property getter emits static int limit() const in C++ (does not compile), and Python ignores IsStatic on properties #180
StandardLanguageGenerator.Separated (Coder/Languages/StandardLanguageGenerator.cs:549-556) lowers a property getter with IsReadOnly = true even when IsStatic is set.
CppGenerator (Coder/Languages/CppGenerator.cs:216-219) then writes const whenever IsReadOnly is set.
A static member function cannot be cv-qualified.
Python:PythonGenerator (Coder/Languages/PythonGenerator.cs:108-152) never reads declaration.IsStatic for properties, so it always writes an instance @property.
Failure scenario
Input: PropertyDeclaration("Limit", int) { IsStatic = true, HasGetter = true } with getter body return 10, inside class Counter.
C++: the output is static int limit() const { return 10; }. g++ -std=c++20 fails with "static member function 'static int Counter::limit()' cannot have cv-qualifier".
Python: the output is @property def Limit(self). Counter.Limit evaluates to the property object, not 10.
Suggested fix
In Separated, set IsReadOnly = !property.IsStatic. Also guard the C++ const with !funcDecl.IsStatic, which covers a hand-built static, read-only FunctionDeclaration too.
Python: lower a static property to @staticmethod getter and setter functions, as the C, Rust and Go paths do, or write it as inexpressible.
Acceptance criteria
The C++ compile tests include a static property with a getter, and it compiles.
A Python test shows that a static property is reachable from the class.
Category: Bug (generated code does not compile, wrong semantics)
Priority: Medium. Generated C++ for a static property getter fails to compile. Generated Python runs but returns the wrong value: it gives the property object instead of the value.
Area / suggested owner: Property lowering (StandardLanguageGenerator.Separated), CppGenerator, PythonGenerator.
Activity
matt-edmondson commentedon Oct 6, 2026
Triage
StandardLanguageGenerator.Separated),CppGenerator,PythonGenerator.PythonGenerator, but only thelongtype mapping).Generated by Claude Code