Skip to content

Commit d16e493

Browse files
committed
Clarify the error we emit when we see an unexpected null pointer
1 parent 031f112 commit d16e493

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/runtime/DynamicCast.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ static HeapObject * getNonNullSrcObject(OpaqueValue *srcValue,
126126

127127
std::string srcTypeName = nameForMetadata(srcType);
128128
std::string destTypeName = nameForMetadata(destType);
129-
const char * const msg = "Found unexpected null pointer value"
130-
" while trying to cast value of type '%s' (%p)"
131-
" to '%s' (%p)%s\n";
129+
const char * const msg = "Non-Optional value of type '%s' (%p)"
130+
" holds a null pointer?!"
131+
" (Detected while casting to '%s' (%p))%s\n";
132132
if (runtime::bincompat::useLegacyPermissiveObjCNullSemanticsInCasting()) {
133133
// In backwards compatibility mode, this code will warn and return the null
134134
// reference anyway: If you examine the calls to the function, you'll see

0 commit comments

Comments
 (0)