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
This commit is contained in:
parent
9e62876647
commit
245a954b25
8 changed files with 149 additions and 97 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
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)
|
||||
first type mismatch at position: 1
|
||||
required type for x: var seq[T]
|
||||
but expression 'k' is of type: Alias
|
||||
proc add(x: var string; y: string)
|
||||
first type mismatch at position: 1
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
'''
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
discard """
|
||||
errormsg: '''ambiguous call; both foobar.async'''
|
||||
line: 9
|
||||
line: 10
|
||||
disabled: "32bit"
|
||||
"""
|
||||
|
||||
import foobar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue