3 ms·
You could do something like this: plus_one(x::Number) = x + 1 function plus_one(x) @warn "untested type usage of plus_one" x + 1 end That's cumb
by oivey 4y ago
You could do something like this:
plus_one(x::Number) = x + 1
function plus_one(x)
@warn "untested type usage of plus_one"
x + 1
end
That's cumbersome, but a macro could make it less annoying.
- gugagore 4y agoThat is not a full solution to the problem of detecting untested types. What if "plus_one" works for Int, Float32, etc. but not with MyNumber, all of which would dispatch to "plus_one(::Number)".