Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type mismatch in .nimble\pkgs\compiler-#fix-renderer\compiler\astalgo.nim(428, 11) #19507

Open
johannes-riecken opened this issue Feb 9, 2022 · 0 comments

Comments

@johannes-riecken
Copy link

Proc value(..., val: BiggestInt) passes wrong type of argument to add.

The function is defined like this:

proc value(this: var DebugPrinter; value: BiggestInt) =
  if this.useColor:
     this.res.add numberStyle
  this.res.add value
  if this.useColor:
     this.res.add resetStyle

The error message looks as follows:

/Users/rieckenj/.nimble/pkgs/compiler-#fix-renderer/compiler/astalgo.nim(428, 11) Error: type mismatch: got <string, BiggestInt>
but expected one of:
proc add(x: var string; y: char)
  first type mismatch at position: 2
  required type for y: char
  but expression 'value' is of type: BiggestInt
proc add(x: var string; y: cstring)
  first type mismatch at position: 2
  required type for y: cstring
  but expression 'value' is of type: BiggestInt
proc add(x: var string; y: string)
  first type mismatch at position: 2
  required type for y: string
  but expression 'value' is of type: BiggestInt
$ nim -v
Nim Compiler Version 1.6.2 [MacOSX: amd64]
Compiled at 2021-12-17
Copyright (c) 2006-2021 by Andreas Rumpf

active boot switches: -d:release -d:nimUseLinenoise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant