fields broken with inheritance #133
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#133
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I think this field initialization check problem is also related to the
super
(#136) and somehow related to the module type (#40) (should be 'class type' here though).. So maybe we should settle how should this be done, what should be supported and what the semantics should be?If I understand it correctly, in this case the issue here is more related to the
super
, if we does not allow arbitrary class methods be called in a static way and only allow the special case ofsuper
, things would be more limited, but would probably involve less changes to the type system.I am not entirely sure... To support arbitrary class methods called in a static method way would definitly be more expressive, but might involve some non-trivial changes to the type system (things like name collision between variable names and class names, type coercion of
self
..)We don't need to support static methods AFAICT.
How is this related to module type? IIRC I said we should get all the fields of parent class to child class for inheritance? (with order preserved) That should fix the problem.
Ah, yes not closely related, I was just saying that if we want to support calling static method we need to somehow resolve class' name in the type inference, similar to resolve imported modules name.
Yes getting all the fields of parent with order preserved should fix the problem of field init check, it's just about how we decided the way users should call parent's
__init__
?I think we can resolve the class name with symbol resolver?
abdul124 referenced this issue2024-08-19 10:46:33 +08:00