Skip to content

Using Adapt within @testset #102

@milankl

Description

@milankl

Getting this error not sure why. Found a workaround in our case just want to flag it here!

julia> using Adapt

julia> using Test

julia> @testset "abc" begin
           struct ABC end
           Adapt.@adapt_structure ABC
       end
ERROR: LoadError: UndefVarError: `ABC` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] eval(m::Module, e::Any)
   @ Core ./boot.jl:489
 [2] var"@adapt_structure"(__source__::LineNumberNode, __module__::Module, T::Any)
   @ Adapt ~/.julia/packages/Adapt/2UZ81/src/macro.jl:8
in expression starting at REPL[3]:3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions