Polymorphism Fixes #104
No reviewers
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#104
Loading…
Reference in New Issue
No description provided.
Delete Branch "polymorphism_fixes"
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?
@ -104,0 +103,4 @@
let mut instance =
defs[resolver
.get_identifier_def("run".into())
.unwrap_or_else(|| panic!("cannot find `run() -> int32 entry point`")).0
I don't think the
-> int32
part is relevant. And remove the`
@ -151,1 +150,3 @@
(*name, (self.from_unifier_type(unifier, primitives, ty.0, cache), ty.1))
.filter_map(|(name, ty)| {
// filter out functions as they can have type vars and
// will not affect codegen
What does this comment mean? Did you mean "cannot have type vars..."?
Yes, here since we are concretizing types, all class fields should not have type vars. But due to partial instantiation of class methods, there might still be some methods whose signature contains type vars. So I filter out all the functions here since class methods here does not affect codegen.
I will put clearer comments here in a later commit.
@ -735,3 +728,1 @@
} else {
instantiated = true;
break;
// need to do this for partial instantiated function
to do what?
To change the way to check whether a function is instantiated (e.g., as long as there exits one uninstantiated type var, the function is not instantiated)
Thanks for pointing it out, I will also put clearer comments here in a later commit.
Thanks