On Sat, Apr 02 2016, Yichao Yu wrote: > On Sat, Apr 2, 2016 at 2:28 AM, Tamas Papp <[email protected]> wrote: >> On Fri, Apr 01 2016, Yichao Yu wrote: >> >>> On Fri, Apr 1, 2016 at 5:33 AM, Tamas Papp <[email protected]> wrote: >>>> Hi, >>>> >>>> I ran into a problem with the result type of Dict comprehensions. If I >>>> wrap the comprehension in a function, it produces the narrowest type, >>>> otherwise the type of value is Any. Code looks like this: >>> >>> https://github.com/JuliaLang/julia/issues/7258 >> >> Sorry, I don't understand why it is the same issue. The type of >> arguments in the comprehension is always the same, just that one version >> is wrapped in a function inside a function, and the other one isn't. > > And that's exactly where type inference sensitivity comes in. One of > them is inferable and the other not.
Thanks, now I think I get it. So for the time being, is wrapping something in a function to make it inferable a reasonable general workaround? Best, Tamas
