Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Iterator problem #709

Open
MovingtoMars opened this issue Feb 27, 2016 · 5 comments
Open

Iterator problem #709

MovingtoMars opened this issue Feb 27, 2016 · 5 comments
Labels

Comments

@MovingtoMars
Copy link
Member

I'm not sure what's going on yet.

ark build -I lib tests/iterator.ark -o a.out --loglevel=debug

error: [iterator:23:40] Mismatched types: int and T
            Some(val) => {io::printInt(val); io::println("");},
                                       ^
@MovingtoMars MovingtoMars changed the title Iterator problem Codegen problem? Feb 27, 2016
@MovingtoMars
Copy link
Member Author

Caused by commit 9b9e92c

@kiljacken
Copy link
Member

Any time a substitution type leaks you can bet the problem is in the inference. I'll start looking at it once I'm done with breakfast

@MovingtoMars MovingtoMars changed the title Codegen problem? Iterator problem Feb 28, 2016
@kiljacken
Copy link
Member

This happens due to inference of generics being a problematic to manage cleanly with the current system of generics. A clean fix depends on #739

@MovingtoMars
Copy link
Member Author

What do you mean?

@kiljacken
Copy link
Member

The thing that happens is, that we "infer" the type of the variable, as a Substitution type is treated like any old type. And because we do this before the actual type is inferred we end up using the substitution type instead. Thus the need to check whether a type contains any unsatisfied generic parameters

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants