Tighten the conversion from tyRange to scalar types (#10495)

* Tighten the conversion from tyRange to scalar types.

Introduce the `isIntConv` rule for unsigned types.
Do not allow mixed-signedness conversions between ranges and scalar types.

* More json adjustments
This commit is contained in:
LemonBoy 2019-02-23 11:52:52 +01:00 • committed by Andreas Rumpf
commit 71df1b060b
3 changed files with 66 additions and 14 deletions

View file

@ -105,3 +105,16 @@ block tcolors:
return rgb(red(a) +! red(b), green(a) +! green(b), blue(a) +! blue(b))
rgb(34, 55, 255)
block:
type
R8 = range[0'u8 .. 10'u8]
R16 = range[0'u16 .. 10'u16]
R32 = range[0'u32 .. 10'u32]
var
x1 = R8(4)
x2 = R16(4)
x3 = R32(4)
doAssert $x1 & $x2 & $x3 == "444"