New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rock can't pick up generic type info from the typeargs of the return value of closure #921
Comments
That is harder to fix than expected, ACS's get their return type from the function type in the call's function definition, so the closure is resolved to be of type |
I wonder why the |
@Shamanas Realtypizing does pick up on quite a few cases, apparently |
I tried adding it last night but I got stuck because I am apparently getting |
Ah.. maybe the function's returnType is being realtypized, but not the function's type (if you see what I mean) |
Just for reference (so I don't forget and I fix this after going to the beach :P), I was assuming the return type of the function pointer was set to the inferred type but there is a special field, inferredReturnedType, which should work (I changed this back on my other PC and it resulted in crashes on some test programs, probably didn't do correct null checking) I wonder whether BaseType searchTypeArg will work for "just" T so I can use the same code for Will probably fix that later, perhaps tomorrow morning in the worst case scenario. |
who says ooc devs have no life!
famous last words, but the rest of your post is promising. |
searchTypeArgs doesn't actually work in this case, because it obviously looks into the type's ref to find the typearg name you requested. Instead, we should be able to provide two types, one unqualified (or partially qualified) and one fully qualified and extract a type arg from there. This should work for all types though, not just "base" types, I guess I'll write something in typeAnalysis |
I know, quite the title.
Here is what I mean:
The above fails with
error Missing info for type argument T. Have you forgotten to qualify foo<T> (f: Func () -> Cell), e.g. List<Int>?
(btw, this error message is pretty misleading to beginners since explicitly qualifying functions, rather than types, is illegal in ooc)The text was updated successfully, but these errors were encountered: