If I define a module and then try to verify interfaces from outside of the module, it gets confused:
julia> module Foo
using BinaryTraits
using BinaryTraits.Prefix: Is
@trait Cute
@implement Is{Cute} by awesome(_)
struct Wat end
@assign Wat with Is{Cute}
end
julia> @check Foo.Wat
✅ Main.Foo.Wat has no interface contract requirements.
The workaround is to run the check inside the module, or expose a method to do that:
julia> module Bar
using BinaryTraits
using BinaryTraits.Prefix: Is
@trait Cute
@implement Is{Cute} by awesome(_)
struct Wat end
@assign Wat with Is{Cute}
testme() = @check Wat
end
julia> Bar.testme()
┌ Warning: Missing implementation
│ contract = BinaryTrait{Main.Bar.Cute}: BinaryTraits.Prefix.Positive{Main.Bar.Cute} ⇢ awesome(🔹)
└ @ BinaryTraits ~/.julia/dev/BinaryTraits/src/interface.jl:62
❌ Main.Bar.Wat is missing these implementations:
1. BinaryTrait{Main.Bar.Cute}: BinaryTraits.Prefix.Positive{Main.Bar.Cute} ⇢ awesome(🔹) (Missing implementation)
If I define a module and then try to verify interfaces from outside of the module, it gets confused:
The workaround is to run the check inside the module, or expose a method to do that: