Closed tlienart closed 2 years ago
right so that won't be easy to directly fix; there's something to do with when that -
is evaluated. Interestingly this works fine:
neg(a) = -a
@mlj_model mutable struct Foo
a::Int = neg(1)::(_ > -2)
end
So I guess we can either try the hard way which is to fix this (it's not clear to me how); or document that users should use such a neg
for negative default vals (which will likely be rare).
A bit less hacky (would still need to be documented)
@mlj_model mutable struct Bar
a::Int = (-)(1)::(_ > -2)
end
@tlienart Thanks for that. Good catch.
While this is annoying, I think it low priority. I vote for the documented hack.
Closing in favour of above MLJ 504
MLJ 504 is just a documentation issue.
Since this issue was opened we've not actually bumped against it. I think the documentation warning, already added suffices and am closing.
I'm investigating, the issue is that
-5
is effectively an op