Skip to content

Commit 3ce9fa3

Browse files
committed
---
yaml --- r: 294655 b: refs/heads/tensorflow c: ce61dfe h: refs/heads/master i: 294653: c938e19 294651: 50416c0 294647: 73b5b94 294639: 34937f7 294623: ee5fbe5 294591: c1b39c9 294527: 5e63973 294399: 1cbca49
1 parent 2b5b90b commit 3ce9fa3

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: 1499811add498d18baf2faba6add19b72de19ca0
819+
refs/heads/tensorflow: ce61dfeadf7b884ae9b47a9b7b9a2b11f79c6b1a
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/lib/Sema/CSDiagnostics.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,17 +2147,17 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
21472147
// to replace the metatype with 'Self'
21482148
// error saying the lookup cannot be on a protocol metatype
21492149
Optional<InFlightDiagnostic> Diag;
2150-
auto baseObjTy = BaseType;
2150+
auto baseTy = BaseType;
21512151

2152-
if (auto metatypeTy = baseObjTy->getAs<AnyMetatypeType>()) {
2152+
if (auto metatypeTy = baseTy->getAs<AnyMetatypeType>()) {
21532153
auto instanceTy = metatypeTy->getInstanceType();
21542154

21552155
// This will only happen if we have an unresolved dot expression
21562156
// (.foo) where foo is a protocol member and the contextual type is
21572157
// an optional protocol metatype.
21582158
if (auto objectTy = instanceTy->getOptionalObjectType()) {
21592159
instanceTy = objectTy;
2160-
baseObjTy = MetatypeType::get(objectTy);
2160+
baseTy = MetatypeType::get(objectTy);
21612161
}
21622162

21632163
if (instanceTy->isExistentialType()) {
@@ -2175,8 +2175,8 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
21752175
instanceTy));
21762176
} else {
21772177
Diag.emplace(emitDiagnostic(
2178-
loc, diag::could_not_use_type_member_on_protocol_metatype,
2179-
baseObjTy, Name));
2178+
loc, diag::could_not_use_type_member_on_protocol_metatype, baseTy,
2179+
Name));
21802180
}
21812181

21822182
Diag->highlight(baseRange).highlight(getAnchor()->getSourceRange());
@@ -2200,8 +2200,7 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
22002200
// components, let's provide a tailored diagnostic and return because
22012201
// that is unsupported so there is no fix-it.
22022202
if (locator->isForKeyPathComponent()) {
2203-
InvalidStaticMemberRefInKeyPath failure(expr, getConstraintSystem(),
2204-
member, locator);
2203+
InvalidStaticMemberRefInKeyPath failure(expr, cs, member, locator);
22052204
return failure.diagnoseAsError();
22062205
}
22072206

@@ -2210,13 +2209,13 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
22102209
loc, diag::could_not_use_enum_element_on_instance, Name));
22112210
} else {
22122211
Diag.emplace(emitDiagnostic(
2213-
loc, diag::could_not_use_type_member_on_instance, baseObjTy, Name));
2212+
loc, diag::could_not_use_type_member_on_instance, baseTy, Name));
22142213
}
22152214

22162215
Diag->highlight(getAnchor()->getSourceRange());
22172216

22182217
if (Name.isSimpleName(DeclBaseName::createConstructor()) &&
2219-
!baseObjTy->is<AnyMetatypeType>()) {
2218+
!baseTy->is<AnyMetatypeType>()) {
22202219
if (auto ctorRef = dyn_cast<UnresolvedDotExpr>(getRawAnchor())) {
22212220
SourceRange fixItRng = ctorRef->getNameLoc().getSourceRange();
22222221
Diag->fixItInsert(fixItRng.Start, "type(of: ");
@@ -2234,7 +2233,7 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
22342233

22352234
// Try to provide a fix-it that only contains a '.'
22362235
if (contextualType) {
2237-
if (baseObjTy->isEqual(contextualType)) {
2236+
if (baseTy->isEqual(contextualType)) {
22382237
Diag->fixItInsert(loc, ".");
22392238
return true;
22402239
}
@@ -2264,7 +2263,7 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
22642263
// since the type can be inferred
22652264
Type secondArgType =
22662265
lastCS->getType(binaryExpr->getArg()->getElement(1));
2267-
if (secondArgType->isEqual(baseObjTy)) {
2266+
if (secondArgType->isEqual(baseTy)) {
22682267
Diag->fixItInsert(loc, ".");
22692268
return true;
22702269
}

0 commit comments

Comments
 (0)