Skip to content

Commit aa631d3

Browse files
Merge cda6b88 into 0eeadff
2 parents 0eeadff + cda6b88 commit aa631d3

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

Diff for: include/swift/AST/DiagnosticsSema.def

-3
Original file line numberDiff line numberDiff line change
@@ -4067,9 +4067,6 @@ WARNING(bitcasting_to_change_function_rep, none,
40674067
"'unsafeBitCast' from function type %0 to %1 changes @convention and "
40684068
"is undefined; use an implicit conversion to change conventions",
40694069
(Type, Type))
4070-
WARNING(bitcasting_to_downcast, none,
4071-
"'unsafeBitCast' from %0 to %1 can be replaced with 'unsafeDowncast'",
4072-
(Type, Type))
40734070
WARNING(bitcasting_is_no_op, none,
40744071
"'unsafeBitCast' from %0 to %1 is unnecessary and can be removed",
40754072
(Type, Type))

Diff for: lib/Sema/MiscDiagnostics.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -898,15 +898,6 @@ static void diagSyntacticUseRestrictions(const Expr *E, const DeclContext *DC,
898898
return;
899899
}
900900
}
901-
902-
// Unchecked casting to a subclass is better done by unsafeDowncast.
903-
if (fromTy->isBindableToSuperclassOf(toTy)) {
904-
Ctx.Diags.diagnose(DRE->getLoc(), diag::bitcasting_to_downcast,
905-
fromTy, toTy)
906-
.fixItReplace(DRE->getNameLoc().getBaseNameLoc(),
907-
"unsafeDowncast");
908-
return;
909-
}
910901

911902
// Casting among pointer types should use the Unsafe*Pointer APIs for
912903
// rebinding typed memory or accessing raw memory instead.

0 commit comments

Comments
 (0)