feat(option): builtin Option uses the Nil variant

The lazily registered builtin template now declares Nil = 0 instead of None_.
This commit is contained in:
TermiNexus committed 2026-11-02 22:15:15 +08:00
1 parent 695c886ed0
commit c81ebaa7d4
1 file changed
+1 -1
+1 -1
View File
@@ -73,7 +73,7 @@ novirtual class ClassGenGeneric(ClassGenBase.ClassGenBase):
if self._find_generic_template("Option") is not None: return 1
pp: memhub.MemBuddy* = CompilerFactory.factory.PermPool
if pp is None: return 0
src: str = "renum Option[T]:\n class Some:\n value: T\n None_ = 0\n"
src: str = "renum Option[T]:\n class Some:\n value: T\n Nil = 0\n"
tree: ast.AST* = ast.parse_ex(src, pp, pp)
if tree is None or tree.children is None: return 0
cd: ast.ClassDef* = None