Skip to content

@allocated false positive on v1.12? #57064

@nsajko

Description

@nsajko

This passes on v1.11, but fails on v1.12:

using Test
function f(r)
    sum(r) 
end
@testset "t" begin
    @test 15 == f(1:5) 
    @test 0 == @allocated f(1:5) 
end

The workaround is:

const r = 1:5
@testset "t" begin
    @test 15 == f(r) 
    @test 0 == @allocated f(r) 
end

Metadata

Metadata

Assignees

Labels

regressionRegression in behavior compared to a previous versionregression 1.12Regression in the 1.12 releasetestsystemThe unit testing framework and Test stdlib

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions