Review TypeChecker::operator() handling of empty TypeSignature

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Dave fixed a related bug in SERVER-123790. This might not be all that important, but I don't think we're handling the empty type signature correctly in the TypeChecker code, generally speaking.

      For instance, in this unit test

      TEST(TypeCheckerTest, Sus) {
          TypeChecker checker;
          checker.bind(ProjectionName{"x"}, TypeSignature{});
          auto tree = make<BinaryOp>(Operations::FillEmpty,
                                     make<Variable>(ProjectionName{"x"}),
                                     Constant::str("bar"));
          checker.typeCheck(tree);
          ASSERT(tree.is<BinaryOp>());
          ASSERT_EQ(tree.cast<BinaryOp>()->op(), Operations::FillEmpty);
      } 

      we remove the FillEmpty here

      !TypeSignature::kNothingType.isSubset(lhs) 

      which speaks to a class of bug where we're using isSubset without considering the empty type signature case.

            Assignee:
            Evan Bergeron
            Reporter:
            Evan Bergeron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: