Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Error on tchipmunk.nim test compilation #27

Open
trifleneurotic opened this issue Jan 2, 2022 · 1 comment
Open

Error on tchipmunk.nim test compilation #27

trifleneurotic opened this issue Jan 2, 2022 · 1 comment

Comments

@trifleneurotic
Copy link

After a clean clone of the repo, and attempting to compile the tchipmunk.nim test just using nim -c, I get a few warnings but an error halts the process:

tchipmunk.nim(69, 30) Error: type mismatch: got <float64, Vec[2, system.float32]>
but expected one of:
proc `-`(x, y: float): float
  first type mismatch at position: 2
  required type for y: float
  but expression 'distance(vec2f(0), vec2f(fx, fy))' is of type: Vec[2, system.float32]
proc `-`(x, y: float32): float32
  first type mismatch at position: 2
  required type for y: float32
  but expression 'distance(vec2f(0), vec2f(fx, fy))' is of type: Vec[2, system.float32]
proc `-`(x: float): float
  first type mismatch at position: 2
  extra argument given
proc `-`(x: float32): float32
  first type mismatch at position: 2
  extra argument given
proc `-`[N, T](val`gensym2: T; v`gensym2: Vec[N, T]): Vec[N, T]
  first type mismatch at position: 2
  required type for v`gensym2: Vec[-.N, -.T]
  but expression 'distance(vec2f(0), vec2f(fx, fy))' is of type: Vec[2, system.float32]
28 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them

expression: 1.0 - distance(vec2f(0), vec2f(fx, fy))`

Environment:

Kernel: 5.15.12-arch1-1 x86_64
bits: 64
compiler: gcc v: 11.1.0
Distro: EndeavourOS
base: Arch Linux
nimble v0.13.1 compiled at 2021-12-17 00:56:36
Nim Compiler Version 1.6.2 [Linux: amd64]

@EriKWDev
Copy link

EriKWDev commented Mar 3, 2022

Changed line 69's distance(vec2f(0), vec2f(fx, fy)) to length(vec2f(fx, fy)) and now it compiles.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants