Skip to content

@compat get for Nullable types throws a BoundsError #228

@BenLauwens

Description

@BenLauwens

I am the maintainer of SimJulia and recently the @compat macro for getting a Nullable type in Julia v0.3 and Julia v0.4 throws a BoundsError.

I isolated the problem with following small example:

`using Compat

type Test
a :: Float64
end

type TestCompat
t :: @compat Nullable{Test}
function TestCompat()
tc = new()
tc.t = @compat Nullable{Test}()
return tc
end
end

tc = TestCompat()
@compat get(tc.t)`

In Julia v0.4 without the @compat macro everything works fine (a NullException is thrown) but with the macro I get the following error message:
ERROR: LoadError: BoundsError: attempt to access 2-element Array{Any,1}:
:get
:(tc.t)
at index [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