@@ -452,7 +452,7 @@ func (c *checker) arrayElems(typ super.Type, elems []sem.ArrayElem) super.Type {
452452 panic (elem )
453453 }
454454 }
455- return fuser .Type (c )
455+ return fuser .Type ()
456456}
457457
458458func (c * checker ) recordElems (typ super.Type , elems []sem.RecordElem ) super.Type {
@@ -474,7 +474,7 @@ func (c *checker) recordElems(typ super.Type, elems []sem.RecordElem) super.Type
474474 panic (elem )
475475 }
476476 }
477- return fuser .Type (c )
477+ return fuser .Type ()
478478}
479479
480480func (c * checker ) callBuiltin (call * sem.CallExpr , args []super.Type ) super.Type {
@@ -520,7 +520,7 @@ func (c *checker) pathsToType(paths []pathType) super.Type {
520520 for _ , path := range paths {
521521 fuser .fuse (c .pathToRec (path .typ , path .elems ))
522522 }
523- return fuser .Type (c )
523+ return fuser .Type ()
524524}
525525
526526func (c * checker ) pathToRec (typ super.Type , elems []string ) super.Type {
@@ -593,7 +593,7 @@ func (c *checker) putPaths(typ super.Type, puts []pathType) super.Type {
593593 for _ , put := range puts {
594594 fuser .fuse (c .pathToRec (put .typ , put .elems ))
595595 }
596- return fuser .Type (c )
596+ return fuser .Type ()
597597}
598598
599599type path struct {
@@ -624,7 +624,7 @@ func (c *checker) fuse(types []super.Type) super.Type {
624624 for _ , typ := range types {
625625 fuser .fuse (typ )
626626 }
627- return fuser .Type (c )
627+ return fuser .Type ()
628628}
629629
630630func (c * checker ) boolean (loc ast.Node , typ super.Type ) bool {
@@ -1063,13 +1063,15 @@ func (c *checker) error(loc ast.Node, err error) {
10631063}
10641064
10651065func (c * checker ) newFuser () * fuser {
1066- return & fuser {sctx : c .t .sctx }
1066+ return & fuser {sctx : c .t .sctx , unknown : c . unknown }
10671067}
10681068
10691069type fuser struct {
1070- sctx * super.Context
1071- typ super.Type
1072- sch * agg.Schema
1070+ sctx * super.Context
1071+ unknown super.Type
1072+
1073+ typ super.Type
1074+ sch * agg.Schema
10731075}
10741076
10751077func (f * fuser ) fuse (typ super.Type ) {
@@ -1084,12 +1086,12 @@ func (f *fuser) fuse(typ super.Type) {
10841086 }
10851087}
10861088
1087- func (f * fuser ) Type (c * checker ) super.Type {
1089+ func (f * fuser ) Type () super.Type {
10881090 if f .sch != nil {
10891091 return f .sch .Type ()
10901092 }
10911093 if f .typ != nil {
10921094 return f .typ
10931095 }
1094- return c .unknown
1096+ return f .unknown
10951097}
0 commit comments