a.go:
package a
type S[T any] struct {
}
func (b *S[T]) build() *X[T] {
return &X[T]{f:0}
}
type X[T any] struct {
f int
}
b.go:
package b
import "./a"
func B() {
var x a.S[int]
_ = x
}
main.go:
package main
import "./b"
func main() {
b.B()
}
This should compile successfully. Instead we get the error:
a.go:7:16: invalid field name a.f in struct initializer
This is an error from the old typechecker when importing code (from b into main, I think). The error occurs in the phase where we're building more instantiations after inlining.
This example is reduced from an example generated by my generifier. It was originally package html_test importing package html importing a generified version of package string.
@danscales
a.go:
b.go:
main.go:
This should compile successfully. Instead we get the error:
This is an error from the old typechecker when importing code (from b into main, I think). The error occurs in the phase where we're building more instantiations after inlining.
This example is reduced from an example generated by my generifier. It was originally package html_test importing package html importing a generified version of package string.
@danscales