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:
1 parent
695c886ed0
commit
c81ebaa7d4
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user