gopherdata / gopherdata/gophernotes

not a package: "n" in n.multiply <*ast.SelectorExpr>

Open
#254 1 comment 0 reactions 1 assignee Claimed by @cosmos72 View on GitHub
bug
Dominant language
Go
Stars
4k
Forks
264
Avg merge
7d 21h
Merged PRs (30d)
1

Description

```go
type Node struct {
value int
next *Node
}

func (n Node) multiply(x int) int {
return n.value * x
}

n := Node{2, nil}
n.multiply(3)
```

repl.go:11:1: not a package: "n" in n.multiply <*ast.SelectorExpr>

However, this works:

```go
type Node struct {
value int
}

func (n Node) multiply(x int) int {
return n.value * x
}

n := Node{2}
n.multiply(3)
```

Versions:

- go version go1.19.2 linux/amd64
- gophernotes@v0.7.5

Related to #240

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.