Commit 4827539e authored by Tom Niget's avatar Tom Niget

Fix assignment for class types

parent f5b67d50
# coding: utf-8
# norun
# https://lab.nexedi.com/xavier_thompson/typon-snippets/tree/master/references
class Person:
name: str
......@@ -13,13 +12,12 @@ class Person:
def afficher(self):
print("afficher", self.name, self.age)
# def creer():
# return Person("jean", 123)
def creer():
return Person("jean", 123)
if __name__ == "__main__":
y = Person
#x = creer()
x = Person("jean", 123)
x = creer()
print("name", x.name)
print("age", x.age)
x.afficher()
......
......@@ -28,6 +28,7 @@ def emit_class(name: str, node: ConcreteType) -> Iterable[str]:
yield ">"
yield f"struct {name}__oo : referencemodel::classtype<_Base0, {name}__oo<>> {{"
yield f"static constexpr std::string_view name = \"{name}\";"
yield f"auto operator=(const {name}__oo&) const {{ return *this; }}"
# inner = ClassInnerVisitor2(node.inner_scope)
# for stmt in node.body:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment