Skip to content

Generator Type Instability #18695

@cortner

Description

@cortner
r = rand(10)
test1(r) = sum( t^2 for t in r )
test2(r)= sum( [t^2 for t in r] )
@code_warntype test1(r)   # return type Any is inferred
@code_warntype test2(r)   # return type Float64 is inferred

This is discussed at length here

Apparently this should be a feature request, but I think it is actually a bug.

The "bug" was confirmed on 0.5.0 and on 0.6.0-dev.787

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions