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

starlark: named constant values of derived integer types always get converted to 0 #3801

Closed
arvidfm opened this issue Aug 30, 2024 · 0 comments · Fixed by #3802
Closed

starlark: named constant values of derived integer types always get converted to 0 #3801

arvidfm opened this issue Aug 30, 2024 · 0 comments · Fixed by #3802

Comments

@arvidfm
Copy link
Contributor

arvidfm commented Aug 30, 2024

What version of Delve are you using (dlv version)?

master

What version of Go are you using? (go version)?

go1.22.5

What operating system and processor architecture are you using?

Linux, AMD Ryzen 9 3900X 12-Core Processor

What did you do?

I tried to access the value of a variable from Starlark, where the variable is set to the value of a named constant of a type derived from an integer type:

package main

import (
	"fmt"
)

type Uint32 uint32

const MyUint32 Uint32 = 42

func main() {
	a := MyUint32
	fmt.Println(a)
}
> dlv debug
(dlv) b main.main:2
Breakpoint 1 set at 0x4ae25a for main.main() ./main.go:13
(dlv) c
> [Breakpoint 1] main.main() ./main.go:13 (hits goroutine(1):1 total:1) (PC: 0x4ae25a)
[...]
(dlv) source -
>>> eval(None, "a").Variable
Variable<MyUint32 (42)>
>>> eval(None, "a").Variable.Value
0

What did you expect to see?

eval(None, "a").Variable.Value to print 42

What did you see instead?

It prints 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants