Skip to content

Unresolved reference on slice objects #1837

Closed
@vburenin

Description

@vburenin

Recently I started seeing this issue:

screen shot 2015-08-30 at 1 40 27 pm

It happens with arrays/slices defined as a different type. You can see it happens to SomeId struct member.

type TestStruct struct {
    SomeId int
}

type DataSlice []*TestStruct

func NewDataSlice() *DataSlice {
    return &DataSlice{}
}

func ErrorCode() {
    data := NewDataSlice()
    for _, element := range data {
        if element.SomeId > 20 {
            println("some text")
        }
    }
}

Environment:
➜ ~ uname -a
Darwin domain.com 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
screen shot 2015-08-30 at 2 30 26 pm
screen shot 2015-08-30 at 2 29 49 pm

Go: 1.5 and 1.4.2.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions