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

interface variable breaks -autofree #22074

Closed
Checkmate6659 opened this issue Aug 19, 2024 · 0 comments · Fixed by #22555
Closed

interface variable breaks -autofree #22074

Checkmate6659 opened this issue Aug 19, 2024 · 0 comments · Fixed by #22555
Assignees
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: Memory Management Bugs/feature requests, that are related to the memory management of the compiler.

Comments

@Checkmate6659
Copy link

Checkmate6659 commented Aug 19, 2024

V doctor:

V full version: V 0.4.7 f879368.3965a6c
OS: linux, Ubuntu 20.04.6 LTS
Processor: 8 cpus, 64bit, little endian, AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx

getwd: /home/enigma/vlang/bober_mini
vexe: /home/enigma/vlang/v/v
vexe mtime: 2024-08-18 18:33:11

vroot: OK, value: /home/enigma/vlang/v
VMODULES: OK, value: /home/enigma/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.25.1
Git vroot status: weekly.2024.33-26-g3965a6c5
.git/config present: true

CC version: cc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9

What did you do?
./v -g -o vdbg cmd/v && ./vdbg src/main.v

module main

import rand
import rand.pcg32

fn main() {
	rng := rand.PRNG(pcg32.PCG32RNG{})
}

What did you expect to see?

When compiled normally, a PRNG gets created and nothing happens. When compiled using -autofree, a C error appears.

What did you see instead?

src/main.v:7:2: warning: unused variable: `rng`
    5 | 
    6 | fn main() {
    7 |     rng := rand.PRNG(pcg32.PCG32RNG{})
      |     ~~~
    8 | }

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@spytheman spytheman added Bug This tag is applied to issues which reports bugs. Autofree Bugs/feature requests, that are related to -autofree. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. labels Aug 20, 2024
@spytheman spytheman added the Unit: Memory Management Bugs/feature requests, that are related to the memory management of the compiler. label Sep 5, 2024
@felipensp felipensp changed the title rand.pcg32 breaks -autofree interface variable breaks -autofree Oct 17, 2024
@felipensp felipensp self-assigned this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: Memory Management Bugs/feature requests, that are related to the memory management of the compiler.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants