Skip to content

@isdefined sometimes returns a non-boolean #57872

@KristofferC

Description

@KristofferC
using Test: Error, @testset

f() = rand(3,3)

@testset "a" begin
    r0 = f()

    (@isdefined(Error))::Bool
    for x in ()
    end
end

errors with

  TypeError: non-boolean (DataType) used in boolean context

The returned value seems to be the Error itself. Doing random stuff like commenting out the loop or the function call or the test set makes the error go away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorregressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions