Loosen the assertion a bit to make the test suite pass with -O.

Running the test quite with check-swift-optimize revealed that metatypes were not covered by the assert, even though it may occur in the real code.

Swift SVN r28297
This commit is contained in:
Roman Levenstein
2015-05-07 22:29:18 +00:00
parent 9f8fd4e43c
commit 8dac375b4a

View File

@@ -239,8 +239,9 @@ swift::classifyDynamicCast(Module *M,
target.getStructOrBoundGenericStruct() ||
isa<TupleType>(target) ||
isa<SILFunctionType>(target) ||
isa<FunctionType>(target)) &&
"Target should be an enum, struct, tuple or function type");
isa<FunctionType>(target) ||
isa<MetatypeType>(target)) &&
"Target should be an enum, struct, tuple, metatype or function type");
return DynamicCastFeasibility::WillFail;
}