Closed dynamix closed 6 years ago
Looks like a bug in your code. Shouldn't the argument to m be CellX? And shouldn't the value of Value be X?
Sent from my iPhone
On 12 Oct 2015, at 19:15, Martin Karlsch notifications@github.com wrote:
If I have something like the following and replace X with int
type X generic.Type
type CellX struct { Value int }
func m(X) {}
func example() { a := CellX{} m(CellX{}) }
The following code which wont compile is generated.
type CellInt struct { Value int }
func m(int) {}
func example() { a := CellInt{} m(Cellint{}) } Is this a limitation in how genny works or a bug?
— Reply to this email directly or view it on GitHub.
You are right, the example was not entirely correct ... should be.
type _X_ generic.Type
type Cell_X_ struct {
Value _X_
}
func m(p Cell_X_) {}
func example() {
a := Cell_X_{}
m(Cell_X_{})
}
leads to
package main
type CellInt struct {
Value int
}
func m(p CellInt) {}
func example() {
a := CellInt{}
m(Cellint{})
}
The issue is the same. The CellX passed to m has a lower case "i" whereas the rest has an uppercase "I".
It's almost the same as https://github.com/cheekybits/genny/issues/49 and https://github.com/cheekybits/genny/issues/36. Will be fixed in the next release.
If I have something like the following and replace X with int
The following code which wont compile is generated.
Is this a limitation in how genny works or a bug?