Default constructors #2750
Merged
Thirumalai-Shaktivel merged 11 commits intolcompilers:mainfrom Jul 3, 2024
Merged
Conversation
Collaborator
Thirumalai-Shaktivel
left a comment
There was a problem hiding this comment.
Thank you, I have left some comments.
Some improvements has to be done in the visit_Constructor
Comment on lines
+4
to
+7
| class coord: | ||
| def __init__(self: "coord"): | ||
| self.x: i32 = 3 | ||
| self.y: i32 = 4 |
Collaborator
There was a problem hiding this comment.
Currently, this is represented as:
class coord:
self: "coord"
x: i32 = 3
y: i32 = 4And @tanay-man wants this PR to be merged and work on the arguments initialisation in the next PR.
Collaborator
|
Next implementation is: class test:
def __init__(self: "test", x: i32)
self.x = x
t: test
t.__init__(t, 2) |
Collaborator
|
@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. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have implemented the simplest case of default constructors. I have also added the field
member_functionsto the ASR nodeStruct. @Thirumalai-Shaktivel @certik