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

Can't evaluate struct creation #3177

Closed
kmillikin opened this issue Oct 27, 2022 · 1 comment
Closed

Can't evaluate struct creation #3177

kmillikin opened this issue Oct 27, 2022 · 1 comment

Comments

@kmillikin
Copy link

Delve Version: 1.9.1 and Go go version go1.20-pre3 cl/474093167 +a813be86df linux/amd64.

Test case is simple:

package main

import "fmt"

type Options struct {
        WithBreakfast bool
        WithLunch     bool
        WIthDinner    bool
}

func main() {
        x := Options{}
        fmt.Sprintf("%v", x)
}

Set a breakpoint in main and try to evaluate Options{}:

(dlv) break main.go:13
Breakpoint 1 set at 0x49cca4 for main.main() ./main.go:13
(dlv) c
> main.main() ./main.go:13 (hits goroutine(1):1 total:1) (PC: 0x49cca4)
     8:         WIthDinner    bool
     9: }
    10:
    11: func main() {
    12:         x := Options{}
=>  13:         fmt.Sprintf("%v", x)
    14: }
(dlv) call Options{}
> main.main() ./main.go:13 (hits goroutine(1):1 total:1) (PC: 0x49cca4)
Command failed: expression *ast.CompositeLit not implemented

I should be able to evaluate this here, it's on a line just after an identical expression. (The error message is also really cryptic.)

@aarzilli
Copy link
Member

Duplicate of #1465

@aarzilli aarzilli marked this as a duplicate of #1465 Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants