Skip to content

Int(true) == 255 with broadcasting? #52127

Closed
@MarcMush

Description

@MarcMush

only in 1.9.0-1.9.3, I get this strange bug (not 1.8, not 1.10.0-rc1)

julia> f(n)=(n-=1)<0||[f(n)]
f (generic function with 1 method)

julia> Int.(f.(0))
255

julia> a = f.(0)
true

julia> Int.(a)
1

julia> Int.(true)
1

It seems to happen only when f is non type-stable

Metadata

Metadata

Assignees

No one assigned

    Labels

    backport 1.10Change should be backported to the 1.10 releasecompiler:codegenGeneration of LLVM IR and native code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions