Skip to content

problem with the unreliable approximation of Core.Compiler.return_type #35800

Open
@stev47

Description

@stev47

Using Julia master (newer than 301db97), the following does not infer the correct type (see also the discussion in #34048):

using Test, LinearAlgebra
# @inferred mapreduce(norm, +, [rand(1)]);
@inferred mapreduce(norm, +, [rand(1)]; init = 0.);

Note that the third line works if you comment out the second line (start from a fresh Julia session), which makes testing this issue difficult.

Metadata

Metadata

Labels

bugIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inference

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions