~mna/snow

693bd0a931dbf2f661a3a2d7ff96536136fbb3cb — Martin Angers 1 year, 8 months ago 295abd9
pkg/codegen: some notes on errors in logic
1 files changed, 4 insertions(+), 1 deletions(-)

M pkg/codegen/translate.go
M pkg/codegen/translate.go => pkg/codegen/translate.go +4 -1
@@ 253,14 253,17 @@ func (t *translator) Visit(n semantic.Node) semantic.Visitor {
		t.generatedExpr = &goast.ParenExpr{X: t.generatedExpr}

	case *semantic.Call:
		semantic.Walk(t, n.Fun)

		if n.InitOf != nil {
			// TODO : the name for the initialized struct should be the instantiated one
			// if n.Fun triggers a generic inst...???
			t.generatedExpr = t.callStructInit(n)
			break
			// TODO: once modules exist, the n.Fun might be a qualified struct type, and the initializer
			// might be in a different module, will need to address that...
		}

		semantic.Walk(t, n.Fun)
		ce := &goast.CallExpr{
			Fun:  t.generatedExpr,
			Args: make([]goast.Expr, len(n.Args)),