At the moment no, although there's been discussion of making Bool not a
subtype of Number.

On Mon, Oct 31, 2016 at 2:29 PM, Penn Taylor <rpe...@gmail.com> wrote:

> Is there a way to prevent automatic conversion/promotion between Bool and
> Number types?
>
> Motivating examples:
>
> type Bools
>   a::Bool
>   b::Bool
> end
>
> Bools(1, 0) #=> Bools(true,false)
>
> type Ints
>   a::Int64
>   b::Int64
> end
>
> Ints(true, false) #=> Ints(1,0)
>
> In both of the above cases, I want the construction to fail.
>
> I'm aware that I could write constructors for these types to explicitly
> reject Bool<->Number mismatch, but that gets tedious when there are more
> than a few Number or Bool fields in a type. Wondering if there's an easier
> way.
>

Reply via email to