Skip to content

Commit 9e64ee5

Browse files
Updating tests
1 parent c510d35 commit 9e64ee5

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4337,7 +4337,7 @@ bool ThrowingFunctionConversionFailure::diagnoseAsError() {
43374337

43384338
bool UnecessaryCoecionFailure::diagnoseAsError() {
43394339
auto expr = dyn_cast<CoerceExpr>(getAnchor());
4340-
4340+
43414341
emitDiagnostic(expr->getLoc(), diag::unecessary_same_type_coercion, getToType())
43424342
.fixItRemove(SourceRange(expr->getLoc(),
43434343
expr->getCastTypeLoc().getSourceRange().End));

test/expr/cast/as_coerce.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,15 @@ _ = sr6022_1 as? Any // expected-warning {{conditional cast from '() -> ()' to '
138138

139139
// SR-11295
140140
let sr11295a = "Hello"
141-
_ = sr11295a as String // expected-warning {{casting expression to 'String' doesn't change the type}} {{7-17=}}
141+
_ = sr11295a as String // expected-warning {{casting expression to 'String' doesn't change the type}} {{14-24=}}
142142

143143
let sr11295b = 1
144-
_ = sr11295b as Int // expected-warning {{casting expression to 'Int' doesn't change the type}} {{7-14=}}
144+
_ = sr11295b as Int // expected-warning {{casting expression to 'Int' doesn't change the type}} {{14-21=}}
145145

146146
typealias Type = String
147147

148148
let sr11295c: Type = "Hello Typealias"
149-
_ = sr11295c as String // expected-warning {{casting expression to 'String' doesn't change the type}} {{7-17=}}
149+
_ = sr11295c as String // expected-warning {{casting expression to 'String' doesn't change the type}} {{14-24=}}
150150

151151
let sr11295d = "Hello Typealias"
152-
_ = sr11295d as Type // expected-warning {{casting expression to 'Type' (aka 'String') doesn't change the type}} {{7-15=}}
153-
154-
_ = "Hello" as String // expected-warning {{casting expression to 'String' doesn't change the type}} {{13-23=}}
152+
_ = sr11295d as Type // expected-warning {{casting expression to 'Type' (aka 'String') doesn't change the type}} {{14-22=}}

0 commit comments

Comments
 (0)