Polymorphism Fixes #104
|
@ -148,8 +148,9 @@ impl ConcreteTypeStore {
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(name, ty)| {
|
.filter_map(|(name, ty)| {
|
||||||
// filter out functions as they can have type vars and
|
// here we should not have type vars, but some partial instantiated
|
||||||
// will not affect codegen
|
// class methods can still have uninstantiated type vars, so
|
||||||
|
// filter out all the methods, as this will not affect codegen
|
||||||
if let TypeEnum::TFunc( .. ) = &*unifier.get_ty(ty.0) {
|
if let TypeEnum::TFunc( .. ) = &*unifier.get_ty(ty.0) {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -725,8 +725,9 @@ impl Unifier {
|
||||||
if let TypeEnum::TVar { id, range, .. } =
|
if let TypeEnum::TVar { id, range, .. } =
|
||||||
self.unification_table.probe_value(*v).as_ref()
|
self.unification_table.probe_value(*v).as_ref()
|
||||||
{
|
{
|
||||||
// need to do this for partial instantiated function
|
// for class methods that contain type vars not in class declaration,
|
||||||
// (in class methods that contains type vars not in class)
|
// as long as there exits one uninstantiated type var, the function is not instantiated,
|
||||||
|
// and need to do substitution on those type vars
|
||||||
if k == id {
|
if k == id {
|
||||||
instantiated = false;
|
instantiated = false;
|
||||||
vars.push((*k, range.clone()));
|
vars.push((*k, range.clone()));
|
||||||
|
|
Loading…
Reference in New Issue