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

Nested calls of typeof is panicking the compiler #19168

Closed
Pacheco95 opened this issue Aug 17, 2023 · 0 comments · Fixed by #19323
Closed

Nested calls of typeof is panicking the compiler #19168

Pacheco95 opened this issue Aug 17, 2023 · 0 comments · Fixed by #19323
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@Pacheco95
Copy link

Describe the bug

The compiler is unable to compile nested calls of typeof()

Expected Behavior

The same output "string" for lines 4 and 5

Current Behavior

It panics

Reproduction Steps

fn main() {
	pi := 3.14
	type_ := typeof(pi).name
	println(typeof(type_).name)
	println(typeof(typeof(pi).name).name)
}

Possible Solution

Save the result of the first call to typeof() into a variable before calling it again

Additional Information/Context

No response

V version

Current V version: V 0.4.0 4908ec5, timestamp: 2023-08-17 22:00:14 +0300

Environment details (OS name and version, etc.)

V full version: V 0.4.0 f4d2ec7.4908ec5
OS: linux, Ubuntu 22.04.3 LTS
Processor: 6 cpus, 64bit, little endian, Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz

getwd: /home/user/repositories/playground/v
vexe: /home/user/repositories/v/v
vexe mtime: 2023-08-17 19:09:16

vroot: OK, value: /home/user/repositories/v
VMODULES: OK, value: /home/user/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.34.1
Git vroot status: weekly.2023.33-8-g4908ec57
.git/config present: true

CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3
@Pacheco95 Pacheco95 added the Bug This tag is applied to issues which reports bugs. label Aug 17, 2023
@felipensp felipensp self-assigned this Sep 10, 2023
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants