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

Consts generated out of order #20760

Closed
flibby-jibbit opened this issue Feb 8, 2024 · 0 comments · Fixed by #20770
Closed

Consts generated out of order #20760

flibby-jibbit opened this issue Feb 8, 2024 · 0 comments · Fixed by #20770
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Critical This label is used for critical issues Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Checker Bugs/feature requests, that are related to the type checker. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: Parser Bugs/feature requests, that are related to the V parser or syntax (*not* semantic ones).

Comments

@flibby-jibbit
Copy link

flibby-jibbit commented Feb 8, 2024

Describe the bug

A constant that depends on a previous constant is generated first. See reproduction steps.

Reproduction Steps

module main

import os

const exe_path = os.executable()
const exe_old_path = '${exe_path}.old'

fn main() {
        println(exe_path)
        println(exe_old_path)
}

Expected Behavior

/opt/johann/Development/tmp/vlang/consts/main
/opt/johann/Development/tmp/vlang/consts/main.old

Current Behavior

/opt/johann/Development/tmp/vlang/consts/main
.old

Possible Solution

No response

Additional Information/Context

Happens in an AlmaLinux 9 (AMD64) container, too.

V version

0.4.4 3c0257a

Environment details (OS name and version, etc.)

V full version: V 0.4.4 29511bc.3c0257a
OS: macos, macOS, 14.3, 23D56
Processor: 12 cpus, 64bit, little endian, Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz

getwd: /opt/johann/dev-env-data/vlang/consts
vexe: /opt/vlang/v
vexe mtime: 2024-02-08 17:26:32

vroot: OK, value: /opt/vlang
VMODULES: OK, value: /Users/johann/.vmodules
VTMP: OK, value: /tmp/v_506

env VFLAGS: "-use-os-system-to-run"

Git version: git version 2.43.0
Git vroot status: 0.4.4-210-g3c0257af (1 commit(s) behind V master)
.git/config present: true

CC version: Apple clang version 15.0.0 (clang-1500.1.0.2.5)
thirdparty/tcc status: thirdparty-macos-amd64 46662e20

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.

@flibby-jibbit flibby-jibbit added the Bug This tag is applied to issues which reports bugs. label Feb 8, 2024
@spytheman spytheman added Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Parser Bugs/feature requests, that are related to the V parser or syntax (*not* semantic ones). Unit: Checker Bugs/feature requests, that are related to the type checker. labels Feb 8, 2024
@felipensp felipensp added the Critical This label is used for critical issues label Feb 9, 2024
@felipensp felipensp self-assigned this Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Critical This label is used for critical issues Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Checker Bugs/feature requests, that are related to the type checker. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: Parser Bugs/feature requests, that are related to the V parser or syntax (*not* semantic ones).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants