v icon indicating copy to clipboard operation
v copied to clipboard

`$compile_warn` running multiple times for generic functions

Open impopular-guy opened this issue 1 year ago • 1 comments

Describe the bug

$compile_warn running multiple times for generic functions. It runs expectedly for normal functions

Expected Behavior

warn once

Current Behavior

❯ v run .\warn.v
warn.v:4:5: warning: WARN
    2 |
    3 | fn warn[T](i T) {
    4 |     $compile_warn('WARN')
      |     ~~~~~~~~~~~~~~~~~~~~~
    5 |     println(i)
    6 | }
warn.v:4:5: warning: WARN
    2 |
    3 | fn warn[T](i T) {
    4 |     $compile_warn('WARN')
      |     ~~~~~~~~~~~~~~~~~~~~~
    5 |     println(i)
    6 | }
2

Reproduction Steps

module main

fn warn[T](i T) {
    $compile_warn('WARN')
    println(i)
}

fn main() {
    warn(2)
}

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.3.3 b9a8a21

Environment details (OS name and version, etc.)

OS: windows, Microsoft Windows 11 Home Single Language v22621 64-bit
Processor: 8 cpus, 64bit, little endian,
CC version: Error: exec failed (CreateProcess) with code 2: The system cannot find the file specified.
 cmd: cc --version

getwd: C:\Users\dhrit\Desktop\ToReead\temp\vtest\warn
vmodules: C:\Users\dhrit\.vmodules
vroot: C:\BIN\v
vexe: C:\BIN\v\v.exe
vexe mtime: 2023-02-28 12:11:05
is vroot writable: true
is vmodules writable: true
V full version: V 0.3.3 9794a23.b9a8a21

Git version: git version 2.35.1.windows.2
Git vroot status: weekly.2023.09-7-gb9a8a210
.git/config present: true
thirdparty/tcc status: thirdparty-windows-amd64 1e6e7c6f

impopular-guy avatar Feb 28 '23 17:02 impopular-guy

thankyou

niuggg avatar Mar 03 '23 05:03 niuggg

Already fixed. Thanks.

felipensp avatar Jul 24 '24 11:07 felipensp