I have the following code
import strformat
import sequtils
import strutils
import parseutils
import Constants
import Support
const InputData = "Day04Test.txt"
type
Board = tuple
Numbers :seq[int]
Ranks: seq[seq[int]]
var s :tuple[ Data: seq[string], DrawnNumbers:seq[int], BoardNumbers:seq[seq[seq[int]]]]
s.Data = readfile(RawDataPath & InputData).multireplace((" "," ")).split("\r\n\r\n",1)
echo fmt" Data {s.Data}"
The echo fmt line is underlined from the opening " to the closing ". Two errors are reported.
When the cursor is at the opening "
template/generic instantiation of `fmt` from here
template/generic instantiation of `fmt` from here
Error: internal error: /home/runner/work/nightlies/nightlies/nim/compiler/vmgen.nim(1576, 22)
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp check <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
Anywhere else that is underlined
template/generic instantiation of `fmt` from here
Error: internal error: /home/runner/work/nightlies/nightlies/nim/compiler/vmgen.nim(1576, 22)
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp check <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
Would someone be kind enough to point out what needs to be changed (apart from deleting all the code :-) ) to eliminate these issues. I've tried but can't fathom it.
after deleting unknown imports and RawDataPath your snippet compiles just fine.
would be nice you gave self contained snippets, so we dont have to guess what is relevant and what is missing.
@aEverr. If I go to the terminal in VSCode and type Choosenim Stable and nim I get the following
PowerShell 6.2.3
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS C:\Users\****\source\repos\AoC2021\Nim> choosenim stable
Info: C:\Users\****\.choosenim\downloads\dlls.zip already downloaded
Extracting dlls.zip
Info: Version 1.6.0 already selected
PS C:\Users\****\source\repos\AoC2021\Nim> nim --version
Nim Compiler Version 1.6.0 [Windows: i386]
Compiled at 2021-10-19
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 727c6378d2464090564dbcd9bc8b9ac648467e38
active boot switches: -d:release -d:danger
PS C:\Users\****\source\repos\AoC2021\Nim>
@shirleyquirk. Understood. I'll do better next time if including code.
In the meantime the good news is that I tracked down and deleted all nim related things on my PC, including path stuff. Reinstalled nim using choosenim and the problem has now gone away. SO it looks like yesterdays deletion of a duplicate installation wasn't quite enough.
Unfortunately, the problem has returned. On compilation I'm seeing
[Running] nim compile --verbosity:0 --hints:off --run "c:\Users\*****\source\repos\AoC2021\Nim\Sources\Main.nim"
C:\Users\slayc\.choosenim\toolchains\nim-1.6.0\lib\core\macros.nim(533, 3) Error: undeclared identifier: 'BoardDatarnalErrorFlag'
candidates (edit distance, scope distance); see '--spellSuggest':
(8, 2): 'internalErrorFlag' [proc declared in C:\Users\*****\.choosenim\toolchains\nim-1.6.0\lib\core\macros.nim(525, 6)]
This occurs even when completely deleting my Day04 code leaving only code for Day1, 2 and 3 which previously compiled without issue.
I've got day04 code than is now 'clean' in VSCode by changing from echo fmt to just echo. However I'm still seeing the compiler error out with
[Running] nim compile --verbosity:0 --hints:off --run [Running] nim compile --verbosity:0 --hints:off --run "c:\Users\*****\source\repos\AoC2021\Nim\Sources\Main.nim"
C:\Users\*****\.choosenim\toolchains\nim-1.6.0\lib\core\macros.nim(533, 3) Error: undeclared identifier: 'BoardsAsNumbersrnalErrorFlag'
candidates (edit distance, scope distance); see '--spellSuggest':
(13, 2): 'internalErrorFlag' [proc declared in C:\Users\*****\.choosenim\toolchains\nim-1.6.0\lib\core\macros.nim(525, 6)]
Should I raise this as a compiler issue?
@Araq. Thanks for taking the time to respond. I can confirm that there is no such item as BoardsAsNumbersrnalErrorFlag in my AoC2021 project. I do have a field in a module level tuple that has part of the same name. I'm happy to post a link to the repository if that's helpful.
State = tuple
Data: seq[string]
DrawnNumbers:seq[int]
BoardsAsNumbers:seq[seq[seq[int]]]
Boards:seq[Board]
Win:bool
Answer:int