Skip to content

Commit

Permalink
Update references to optional type construction
Browse files Browse the repository at this point in the history
  • Loading branch information
TristonianJones committed Nov 8, 2022
1 parent 6160484 commit dd7f4ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, option

// If the target type was optional coming in, then the result must be optional going out.
if isOpt || optional {
return decls.NewAbstractType("optional", resultType)
return decls.NewOptionalType(resultType)
}
return resultType
}
Expand Down
4 changes: 2 additions & 2 deletions checker/checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,7 @@ _&&_(_==_(list~type(list(dyn))^list,
in: `has(a.dynamic)`,
env: testEnv{
idents: []*exprpb.Decl{
decls.NewVar("a", decls.NewAbstractType("optional", decls.Dyn)),
decls.NewVar("a", decls.NewOptionalType(decls.Dyn)),
},
},
outType: decls.Bool,
Expand All @@ -2083,7 +2083,7 @@ _&&_(_==_(list~type(list(dyn))^list,
in: `has(a.?b.c)`,
env: testEnv{
idents: []*exprpb.Decl{
decls.NewVar("a", decls.NewAbstractType("optional", decls.NewMapType(decls.String, decls.Dyn))),
decls.NewVar("a", decls.NewOptionalType(decls.NewMapType(decls.String, decls.Dyn))),
},
},
outType: decls.Bool,
Expand Down

0 comments on commit dd7f4ed

Please sign in to comment.