@@ -1894,11 +1894,8 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
1894
1894
case TypeKind::Class: {
1895
1895
auto nominal1 = cast<NominalType>(desugar1);
1896
1896
auto nominal2 = cast<NominalType>(desugar2);
1897
- assert (!type2->is <LValueType>() && " Unexpected lvalue type!" );
1898
- if (!type1->is <LValueType>() &&
1899
- nominal1->getDecl () == nominal2->getDecl ()) {
1897
+ if (nominal1->getDecl () == nominal2->getDecl ())
1900
1898
conversionsOrFixes.push_back (ConversionRestrictionKind::DeepEquality);
1901
- }
1902
1899
1903
1900
// Check for CF <-> ObjectiveC bridging.
1904
1901
if (isa<ClassType>(desugar1) &&
@@ -1907,19 +1904,15 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
1907
1904
auto class2 = cast<ClassDecl>(nominal2->getDecl ());
1908
1905
1909
1906
// CF -> Objective-C via toll-free bridging.
1910
- assert (!type2->is <LValueType>() && " Unexpected lvalue type!" );
1911
- if (!type1->is <LValueType>() &&
1912
- class1->getForeignClassKind () == ClassDecl::ForeignKind::CFType &&
1907
+ if (class1->getForeignClassKind () == ClassDecl::ForeignKind::CFType &&
1913
1908
class2->getForeignClassKind () != ClassDecl::ForeignKind::CFType &&
1914
1909
class1->getAttrs ().hasAttribute <ObjCBridgedAttr>()) {
1915
1910
conversionsOrFixes.push_back (
1916
1911
ConversionRestrictionKind::CFTollFreeBridgeToObjC);
1917
1912
}
1918
1913
1919
1914
// Objective-C -> CF via toll-free bridging.
1920
- assert (!type2->is <LValueType>() && " Unexpected lvalue type!" );
1921
- if (!type1->is <LValueType>() &&
1922
- class2->getForeignClassKind () == ClassDecl::ForeignKind::CFType &&
1915
+ if (class2->getForeignClassKind () == ClassDecl::ForeignKind::CFType &&
1923
1916
class1->getForeignClassKind () != ClassDecl::ForeignKind::CFType &&
1924
1917
class2->getAttrs ().hasAttribute <ObjCBridgedAttr>()) {
1925
1918
conversionsOrFixes.push_back (
@@ -2004,10 +1997,8 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
2004
1997
auto bound1 = cast<BoundGenericType>(desugar1);
2005
1998
auto bound2 = cast<BoundGenericType>(desugar2);
2006
1999
2007
- assert (!type2->is <LValueType>() && " Unexpected lvalue type!" );
2008
- if (!type1->is <LValueType>() && bound1->getDecl () == bound2->getDecl ()) {
2000
+ if (bound1->getDecl () == bound2->getDecl ())
2009
2001
conversionsOrFixes.push_back (ConversionRestrictionKind::DeepEquality);
2010
- }
2011
2002
break ;
2012
2003
}
2013
2004
}
@@ -2427,7 +2418,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
2427
2418
ForceDowncast::create (*this , type2, getConstraintLocator (locator)));
2428
2419
}
2429
2420
2430
- if (type2->getRValueType ()-> is <InOutType>()) {
2421
+ if (type2->is <InOutType>()) {
2431
2422
if (type1->is <LValueType>()) {
2432
2423
// If we're converting an lvalue to an inout type, add the missing '&'.
2433
2424
conversionsOrFixes.push_back (
0 commit comments