Skip to content

Commit 4e5665a

Browse files
committed
[SE-0096] Remove support for dynamicType member
1 parent 1c58315 commit 4e5665a

File tree

6 files changed

+1
-31
lines changed

6 files changed

+1
-31
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,6 @@ ERROR(expr_typeof_expected_expr,PointsToFirstBadToken,
11141114
"expected an expression within 'type(of: ...)'", ())
11151115
ERROR(expr_typeof_expected_rparen,PointsToFirstBadToken,
11161116
"expected ')' to complete 'type(of: ...)' expression", ())
1117-
WARNING(expr_dynamictype_deprecated,PointsToFirstBadToken,
1118-
"'.dynamicType' is deprecated. Use 'type(of: ...)' instead", ())
11191117

11201118
//------------------------------------------------------------------------------
11211119
// Attribute-parsing diagnostics

include/swift/Parse/Tokens.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ KEYWORD(__COLUMN__)
147147
KEYWORD(__FUNCTION__)
148148
KEYWORD(__DSO_HANDLE__)
149149

150-
// FIXME(SE-0096): REMOVE ME
151-
KEYWORD(dynamicType)
152-
153150
// Pattern keywords.
154151
KEYWORD(_)
155152

lib/Parse/ParseExpr.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,35 +1418,12 @@ ParserResult<Expr> Parser::parseExprPostfix(Diag<> ID, bool isExprBasic) {
14181418
continue;
14191419
}
14201420

1421-
// Handle "x.dynamicType" - A metatype expr.
1422-
// Deprecated in SE-0096: `x.dynamicType` becomes `type(of: x)`
1423-
//
1424-
// FIXME(SE-0096): This will go away along with the keyword soon.
1425-
if (Tok.is(tok::kw_dynamicType)) {
1426-
// Fix-it
1427-
auto range = Result.get()->getSourceRange();
1428-
auto dynamicTypeExprRange = SourceRange(TokLoc, consumeToken());
1429-
diagnose(TokLoc, diag::expr_dynamictype_deprecated)
1430-
.highlight(dynamicTypeExprRange)
1431-
.fixItReplace(dynamicTypeExprRange, ")")
1432-
.fixItInsert(range.Start, "type(of: ");
1433-
1434-
// HACK: Arbitrary.
1435-
auto loc = range.Start;
1436-
auto dt = new (Context) DynamicTypeExpr(loc, loc, Result.get(), loc, Type());
1437-
dt->setImplicit();
1438-
Result = makeParserResult(dt);
1439-
continue;
1440-
}
1441-
1442-
14431421
// Handle "x.self" expr.
14441422
if (Tok.is(tok::kw_self)) {
14451423
Result = makeParserResult(
14461424
new (Context) DotSelfExpr(Result.get(), TokLoc, consumeToken()));
14471425
continue;
14481426
}
1449-
14501427

14511428
// If we have '.<keyword><code_complete>', try to recover by creating
14521429
// an identifier with the same spelling as the keyword.

lib/Parse/ParseType.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ ParserResult<TypeRepr> Parser::parseTypeSimple(Diag<> MessageID,
7878
consumeToken(tok::code_complete);
7979
return makeParserCodeCompletionResult<TypeRepr>();
8080
case tok::kw_super:
81-
case tok::kw_dynamicType:
8281
case tok::kw_self:
8382
// These keywords don't start a decl or a statement, and thus should be
8483
// safe to skip over.

tools/swift-ide-test/KnownObjCMethods.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ CLASS_METHOD(NSObject, (0, "class"), Unavailable("use 'self' instead"))
8888

8989
// NSObject protocol
9090
PROTOCOL_INSTANCE_METHOD(NSObject, (0, "class"),
91-
Unavailable("use 'dynamicType' instead"))
91+
Unavailable("use 'type(of:)' instead"))
9292

9393
START_MODULE(Foundation)
9494
INSTANCE_METHOD(NSArray, (0, "init"), DesignatedInit)

utils/vim/syntax/swift.vim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ syn keyword swiftDefinitionModifier
5555

5656
syn keyword swiftIdentifierKeyword
5757
\ Self
58-
\ dynamicType
5958
\ metatype
6059
\ self
6160
\ super

0 commit comments

Comments
 (0)