Closed iciuperca closed 3 days ago
The not used warning is happening because the parts that use the code are in parametric polymorphic procedures which do not get evaluated unless they are used, so the compiler wouldn't know that the import is actually used, unless you called one of the procs.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Please paste
odin report
output:Expected Behavior
Odin standard library should compile with
-vet
Current Behavior
[work@ionut-work /mnt/data/projects/odin]$ odin build ./runtime_error.odin -file -vet /opt/odin/core/math/linalg/general.odin(6:8) Error: 'runtime' declared but not used import "base:runtime" ^
Failure Information (for bugs)
Git bisect show commit 88598c2c6483cdaa9d574d9883a65543d0d31676 as having introduced it. Looking at the commit it does add the import of
base:runtime
even though the code changes do not useruntime
Other pre-existing parts of the code do useruntime
so I'm not sure why the "not used" warning is happening.Steps to Reproduce
Compile the following program
[work@ionut-work /mnt/data/projects/odin]$ cat ./runtime_error.odin package main
import "core:math/linalg"
import "core:fmt"
main :: proc() { fmt.println("PI: %v", linalg.PI) }