Skip to content

Commit

Permalink
Do not attach checked types to constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
slyubomirsky authored Jan 31, 2019
1 parent 6a5a9e3 commit a4c1907
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/relay/pass/type_infer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class TypeInferencer::Resolver : public ExprMutator, PatternMutator {
}

Expr VisitExpr_(const ConstructorNode* op) final {
return AttachCheckedType(op);
return GetRef<Constructor>(op);
}

Expr VisitExpr_(const MatchNode* op) final {
Expand Down Expand Up @@ -657,6 +657,7 @@ struct AllCheckTypePopulated : ExprVisitor {
void VisitExpr(const Expr& e) {
if (e.as<OpNode>()) { return; }
if (e.as<GlobalVarNode>()) { return; }
if (e.as<ConstructorNode>()) { return; }
CHECK(e->checked_type_.defined()) << "Expression: " << e;
return ExprVisitor::VisitExpr(e);
}
Expand Down

0 comments on commit a4c1907

Please sign in to comment.