@@ -1249,17 +1249,17 @@ struct ASTNodeBase {};
12491249 Out << " \n " ;
12501250 abort ();
12511251 }
1252- CanType InputExprTy = E->getArg ()->getType ()-> getCanonicalType ();
1253- CanType ResultExprTy = E->getType ()-> getCanonicalType ();
1254- if (ResultExprTy != FT-> getResult ()-> getCanonicalType ( )) {
1252+ Type InputExprTy = E->getArg ()->getType ();
1253+ Type ResultExprTy = E->getType ();
1254+ if (!ResultExprTy-> isEqual (FT-> getResult () )) {
12551255 Out << " result of ApplyExpr does not match result type of callee:" ;
12561256 E->getType ().print (Out);
12571257 Out << " vs. " ;
12581258 FT->getResult ()->print (Out);
12591259 Out << " \n " ;
12601260 abort ();
12611261 }
1262- if (InputExprTy != FT-> getInput ()-> getCanonicalType ( )) {
1262+ if (!InputExprTy-> isEqual (FT-> getInput () )) {
12631263 TupleType *TT = FT->getInput ()->getAs <TupleType>();
12641264 if (isa<SelfApplyExpr>(E)) {
12651265 Type InputExprObjectTy;
@@ -1274,8 +1274,7 @@ struct ASTNodeBase {};
12741274 checkSameOrSubType (InputExprObjectTy, FunctionInputObjectTy,
12751275 " object argument and 'self' parameter" );
12761276 } else if (!TT || TT->getNumElements () != 1 ||
1277- TT->getElement (0 ).getType ()->getCanonicalType ()
1278- != InputExprTy) {
1277+ !TT->getElement (0 ).getType ()->isEqual (InputExprTy)) {
12791278 Out << " Argument type does not match parameter type in ApplyExpr:"
12801279 " \n Argument type: " ;
12811280 E->getArg ()->getType ().print (Out);
@@ -1892,8 +1891,7 @@ struct ASTNodeBase {};
18921891 return ;
18931892 }
18941893
1895- if (type->getCanonicalType () !=
1896- conformance.getConcrete ()->getType ()->getCanonicalType ()) {
1894+ if (!type->isEqual (conformance.getConcrete ()->getType ())) {
18971895 Out << " conforming type does not match conformance\n " ;
18981896 Out << " conforming type:\n " ;
18991897 type.dump (Out, 2 );
@@ -2518,7 +2516,7 @@ struct ASTNodeBase {};
25182516 }
25192517
25202518 void checkSameType (Type T0, Type T1, const char *what) {
2521- if (T0->getCanonicalType () == T1-> getCanonicalType ( ))
2519+ if (T0->isEqual (T1 ))
25222520 return ;
25232521
25242522 Out << " different types for " << what << " : " ;
@@ -2568,7 +2566,7 @@ struct ASTNodeBase {};
25682566 }
25692567
25702568 void checkSameOrSubType (Type T0, Type T1, const char *what) {
2571- if (T0->getCanonicalType () == T1-> getCanonicalType ( ))
2569+ if (T0->isEqual (T1 ))
25722570 return ;
25732571
25742572 // Protocol subtyping.
0 commit comments