Help with reco check error


#1

Anybody able to give some clues as to what to look for in my code to solve this error?

Error: error(s) found while checking /home/foolmarks/go/src/sha256reco-master/main.go

At the path: [“declarations”][1][“value”][“fields”][0]not implemented: multiple names for one type

thanks.
Mark


#2

Hi Mark,

That error message is bad, and I filed a bug for it. I’m unsure of the cause of that message, but I feel it’s likely code like the following:

func Example(a, b int) { ... }

Right now that form is not supported, so if you have an function with that declaration style, can you rewrite it to be like the following?

func Example(a int, b int) { ... } 

#3

I faced similar error when implementing a 2D matrix in the brain package:

training_data := [][]fixed.Int26_6{
	{0, 0},
    {0, 1},
    {1, 0},
    {1, 1}}

a way around implementing this form (aka Composite literals) was:

training_data := [][]fixed.Int26_6{
    []fixed.Int26_6{0, 0},
	[]fixed.Int26_6{0, 1},
	[]fixed.Int26_6{1, 0},
	[]fixed.Int26_6{1, 1}} 

hope it’s useful:)


#4

@Josh - not just functions, also a struct type declaration needed to be changed in the same way.

From this:

type Hasht struct {
A,B uint32
}

…to this:

type Hasht struct {
A uint32
B uint32
}


#5

Those are both cases of defects in our compiler. I’ll talk with the team on Monday about what’s needed to support that.