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
Python and JavaScript leave a field with no initialiser unset: self.count += 1 raises AttributeError, and JS produces NaN #345
The contract (CLAUDE.md:63, Coder/Ast/FieldDeclaration.cs:10-15) is that a field with no initialiser is value-initialised, so a default-constructed instance is the one the declaration describes. C++ writes int count{};, C# and Go start at zero, and Rust uses Default.
Python and JavaScript don't follow it:
Python fields:PythonGenerator.GenerateFieldDeclaration (Coder/Languages/PythonGenerator.cs:474-503) writes a bare annotation, count: int. That creates no attribute. The remark there cites dataclasses, but no @dataclass is ever emitted, and CLAUDE.md explicitly declines it.
Python auto-properties: these are written as Size: int = None (:131-134).
JavaScript: writes count;, which is undefined (JavaScriptGenerator.cs:359).
Repro
Take a class Counter { count: int; step: int = 1 } with a constructor and a next() method that does count += step; return count;.
In Python, Counter().next() raises AttributeError: 'Counter' object has no attribute 'count'.
Activity
matt-edmondson commentedon Oct 29, 2026
Triage
AttributeErrorat runtime and the generated JS producesNaN.Generated by Claude Code