The value-to-optional and optional-to-optional conversions

are subtype conversions.

Swift SVN r12843
This commit is contained in:
John McCall
2014-01-23 03:05:06 +00:00
parent 09a73e82f1
commit e088646f9b

View File

@@ -889,7 +889,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, TypeMatchKind kind,
// that there is no implicit conversion from T? to @unchecked T?.
{
BoundGenericType *boundGenericType2;
if (concrete && kind >= TypeMatchKind::Conversion &&
if (concrete && kind >= TypeMatchKind::Subtype &&
(boundGenericType2 = type2->getAs<BoundGenericType>())) {
auto decl2 = boundGenericType2->getDecl();
if (auto optionalKind2 = decl2->classifyAsOptionalType()) {