diff options
author | Jasper Jenkins <jasper.vs.jenkins@gmail.com> | 2019-10-10 23:38:08 -0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-10-11 08:38:08 +0200 |
commit | 245a954b250b3e95f68c6bdadeba6ef1425442aa (patch) | |
tree | b45356858b54728f3e36ddfb2b13f8e5a54ed0b9 /tests | |
parent | 9e62876647e4b7d5c31854abf16596b76cd03b4a (diff) | |
download | Nim-245a954b250b3e95f68c6bdadeba6ef1425442aa.tar.gz |
ungeneric unsigned ops (#12230)
* ungenericise unsigned ops, remove nimNewShiftOps * fix/remove tests * update t6448 * fix line info * disable on 32bit * fix different line info * add changelog entry
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arithm/tarithm.nim | 22 | ||||
-rw-r--r-- | tests/concepts/t3330.nim | 14 | ||||
-rw-r--r-- | tests/errmsgs/twrong_at_operator.nim | 8 | ||||
-rw-r--r-- | tests/generics/tgenerics_issues.nim | 8 | ||||
-rw-r--r-- | tests/pragmas/t6448.nim | 3 |
5 files changed, 35 insertions, 20 deletions
diff --git a/tests/arithm/tarithm.nim b/tests/arithm/tarithm.nim index 4625a5ecf..fcb78bd7a 100644 --- a/tests/arithm/tarithm.nim +++ b/tests/arithm/tarithm.nim @@ -4,6 +4,14 @@ int32 int32 1280 1280 +3 +1 +2 +2 +3 +4294967295 +2 +0 ''' """ @@ -145,3 +153,17 @@ block tsubrange: level = min(level + 2, maxLevel).n16 doAssert level == 1 + +block tissue12177: + var a: uint16 = 1 + var b: uint32 = 2 + + echo(b + a) + echo(b - a) + echo(b * a) + echo(b div a) + + echo(a + b) + echo(a - b) + echo(a * b) + echo(a div b) diff --git a/tests/concepts/t3330.nim b/tests/concepts/t3330.nim index ed1590e16..ab77dd347 100644 --- a/tests/concepts/t3330.nim +++ b/tests/concepts/t3330.nim @@ -9,23 +9,23 @@ proc test(foo: Foo[int]) required type for foo: Foo[int] but expression 'bar' is of type: Bar[system.int] t3330.nim(63, 8) Hint: Non-matching candidates for add(k, string, T) -proc add[T](x: var seq[T]; y: openArray[T]) +proc add[T](x: var seq[T]; y: T) first type mismatch at position: 1 required type for x: var seq[T] but expression 'k' is of type: Alias -proc add[T](x: var seq[T]; y: T) +proc add(x: var string; y: string) first type mismatch at position: 1 - required type for x: var seq[T] + required type for x: var string but expression 'k' is of type: Alias proc add(result: var string; x: float) first type mismatch at position: 1 required type for result: var string but expression 'k' is of type: Alias -proc add(x: var string; y: cstring) +proc add(x: var string; y: char) first type mismatch at position: 1 required type for x: var string but expression 'k' is of type: Alias -proc add(x: var string; y: string) +proc add(x: var string; y: cstring) first type mismatch at position: 1 required type for x: var string but expression 'k' is of type: Alias @@ -33,9 +33,9 @@ proc add(result: var string; x: int64) first type mismatch at position: 1 required type for result: var string but expression 'k' is of type: Alias -proc add(x: var string; y: char) +proc add[T](x: var seq[T]; y: openArray[T]) first type mismatch at position: 1 - required type for x: var string + required type for x: var seq[T] but expression 'k' is of type: Alias t3330.nim(63, 8) template/generic instantiation of `add` from here diff --git a/tests/errmsgs/twrong_at_operator.nim b/tests/errmsgs/twrong_at_operator.nim index 9933b0f39..ebf6d966b 100644 --- a/tests/errmsgs/twrong_at_operator.nim +++ b/tests/errmsgs/twrong_at_operator.nim @@ -4,14 +4,14 @@ line: 22 nimout: ''' twrong_at_operator.nim(22, 30) Error: type mismatch: got <array[0..0, type int]> but expected one of: -proc `@`[T](a: openArray[T]): seq[T] - first type mismatch at position: 1 - required type for a: openArray[T] - but expression '[int]' is of type: array[0..0, type int] proc `@`[IDX, T](a: sink array[IDX, T]): seq[T] first type mismatch at position: 1 required type for a: sink array[IDX, T] but expression '[int]' is of type: array[0..0, type int] +proc `@`[T](a: openArray[T]): seq[T] + first type mismatch at position: 1 + required type for a: openArray[T] + but expression '[int]' is of type: array[0..0, type int] expression: @[int] ''' diff --git a/tests/generics/tgenerics_issues.nim b/tests/generics/tgenerics_issues.nim index 3d5d65c75..af71a8938 100644 --- a/tests/generics/tgenerics_issues.nim +++ b/tests/generics/tgenerics_issues.nim @@ -762,11 +762,3 @@ block t3717: var f: Foo[Foo[int]] discard foo(f) - - - -block t5707: - proc foo[T]: seq[int] = - return lc[x | (x <- 1..10, x mod 2 == 0), int] - - doAssert foo[float32]() == @[2, 4, 6, 8, 10] diff --git a/tests/pragmas/t6448.nim b/tests/pragmas/t6448.nim index a1bd747a0..ab2e3811f 100644 --- a/tests/pragmas/t6448.nim +++ b/tests/pragmas/t6448.nim @@ -1,6 +1,7 @@ discard """ errormsg: '''ambiguous call; both foobar.async''' - line: 9 + line: 10 + disabled: "32bit" """ import foobar |