nac3core: toplevel, fix for class constructors + spelling errors #263
No reviewers
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#263
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "iss221_noinit"
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?
Allows for classes without
__init__
constructors.Also corrects some spelling, (contructor -> constructor).
fix #221.
@ -223,4 +223,1 @@
let mut class_method_index_offset = 0;
let init_id = "__init__".into();
let exception_id = "Exception".into();
// TODO: Fix this hack. We will generate constructor for classes that inherit
@pca006132 What is the purpose of this hack?
register_top_level
will returnResult<(StrRef, DefinitionId, Option<Type>), String>
, where the third element of the tuple is the type of the function or constructor of the class (if there is any). If the class does not have a constructor, the third element will be None to avoid adding this to the symbol table. If the class inherits fromException
, we will need to generate a default constructor for it.We will generate or we are generating? I think this is already implemented?
#32 (comment)
Maybe we should document this clearer. This PR will make this code compile:
Closed this pull request due to issues working with git so i just opened a new branch with the changes.
to be honest though, I don't know what reason there was to be checking if the class had a constructor or not, and only if it does have a constructor should it have an associated type.
Pull request closed