Skip to content

Commit a493934

Browse files
Suyash SrijanSuyash Srijan
authored andcommitted
[typechecker] use castTo() instead of getAs()
1 parent a2460b8 commit a493934

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3908,8 +3908,8 @@ CheckedCastKind TypeChecker::typeCheckCheckedCast(Type fromType,
39083908

39093909
auto toConstrainedArchetype = false;
39103910
if (toArchetypeType) {
3911-
auto archetype = toType->getAs<ArchetypeType>();
3912-
toConstrainedArchetype = !archetype->getConformsTo().empty();
3911+
auto archetype = toType->castTo<ArchetypeType>();
3912+
toConstrainedArchetype = archetype && !archetype->getConformsTo().empty();
39133913
}
39143914

39153915
if (fromFunctionType &&

0 commit comments

Comments
 (0)