-
Notifications
You must be signed in to change notification settings - Fork 171
Default constructors #2750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default constructors #2750
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I have left some comments.
Some improvements has to be done in the visit_Constructor
class coord: | ||
def __init__(self: "coord"): | ||
self.x: i32 = 3 | ||
self.y: i32 = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, this is represented as:
class coord:
self: "coord"
x: i32 = 3
y: i32 = 4
And @tanay-man wants this PR to be merged and work on the arguments initialisation in the next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Next implementation is: class test:
def __init__(self: "test", x: i32)
self.x = x
t: test
t.__init__(t, 2) |
@certik, I'm merging this. If you feel something is not correct, do let us know. We will correct that in the subsequent PR's. Thank you @tanay-man for working on this. |
I have implemented the simplest case of default constructors. I have also added the field
member_functions
to the ASR nodeStruct
. @Thirumalai-Shaktivel @certik