Default constructors are constructors stored alongside the class name, i.e.:
class MyServer(mut self: DisconnectedMyServer, def ip_address: IPv4Address) isa Server
The above should be desugared such that we have an init function where these are assigned to self. So the above is roughly desugared to (self should be ignored):
class MyServer(Server):
ip_address = None
__init__(self, ip_address):
self.ip_address = ip_address
Description of potential solution
We desugar class nodes such that:
The class gets the constructor arguments as properties (save for self).
The class assign the constructor arguments to the properties of self.
The type checker should that that there is no other init function in the class.
Current Issue
Default constructors are ignored.
Description of the feature
Default constructors are constructors stored alongside the class name, i.e.:
The above should be desugared such that we have an init function where these are assigned to self. So the above is roughly desugared to (self should be ignored):
Description of potential solution
We desugar class nodes such that:
self
).self
.The type checker should that that there is no other
init
function in the class.