ortho proc does not compile
greenfork opened this issue · 2 comments
greenfork commented
$ nim --version
Nim Compiler Version 1.4.6 [Linux: amd64]
Compiled at 2021-04-15
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 2b6b08032348939e5d355a6cb4faa0169306c17f
active boot switches: -d:release
$ cat vmath_test.nim
import vmath
echo ortho(-1, 1, 1, -1, -1000, 1000)
$ nim c vmath_test.nim
Hint: used config file '/home/grfork/.choosenim/toolchains/nim-1.4.6/config/nim.cfg' [Conf]
Hint: used config file '/home/grfork/.choosenim/toolchains/nim-1.4.6/config/config.nims' [Conf]
........
/tmp/vmath_test.nim(3, 11) template/generic instantiation of `ortho` from here
/home/grfork/.nimble/pkgs/vmath-1.0.4/vmath.nim(804, 16) Error: type mismatch: got <GMat4[system.int], int literal(0),int literal(0), float>
but expected one of:
proc `[]=`(s: var string; i: BackwardsIndex; x: char)
first type mismatch at position: 0
proc `[]=`[I: Ordinal; T, S](a: T; i: I; x: sink S)
first type mismatch at position: 0
proc `[]=`[Idx, T, U, V](a: var array[Idx, T]; x: HSlice[U, V]; b: openArray[T])
first type mismatch at position: 0
proc `[]=`[Idx, T](a: var array[Idx, T]; i: BackwardsIndex; x: T)
first type mismatch at position: 0
proc `[]=`[T, U, V](s: var seq[T]; x: HSlice[U, V]; b: openArray[T])
first type mismatch at position: 0
proc `[]=`[T, U](s: var string; x: HSlice[T, U]; b: string)
first type mismatch at position: 0
proc `[]=`[T](a: var GMat234[T]; i, j: int; v: T)
first type mismatch at position: 0
proc `[]=`[T](s: var openArray[T]; i: BackwardsIndex; x: T)
first type mismatch at position: 0
template `[]=`(s: string; i: int; val: char)
first type mismatch at position: 0
expression: `[]=`(result, 0, 0, 2 / rl)
Original ortho
invocation is taken from emscripter tutorial: https://github.com/treeform/nim_emscripten_tutorial/blob/master/step3.nim#L91
treeform commented
This has been fixed. Thank you for reporting this bug!
greenfork commented
Thank you!