Skip to content

Commit 264500e

Browse files
authored
Merge pull request #1916 from slavapestov/implicit-typealias-astscope
[Swift] Synthesized type alias should be implicit to avoid upsetting ASTScope
2 parents 0bb10e4 + 5dad915 commit 264500e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftASTManipulator.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -1331,21 +1331,15 @@ swift::ValueDecl *SwiftASTManipulator::MakeGlobalTypealias(
13311331
if (!IsValid())
13321332
return nullptr;
13331333

1334-
swift::SourceLoc source_loc;
1335-
1336-
if (m_extension_decl)
1337-
source_loc = m_extension_decl->getEndLoc();
1338-
else
1339-
source_loc = m_function_decl->getEndLoc();
1340-
13411334
swift::ASTContext &ast_context = m_source_file.getASTContext();
13421335

13431336
swift::TypeAliasDecl *type_alias_decl = new (ast_context)
1344-
swift::TypeAliasDecl(source_loc, swift::SourceLoc(), name, source_loc,
1345-
nullptr, &m_source_file);
1337+
swift::TypeAliasDecl(swift::SourceLoc(), swift::SourceLoc(), name,
1338+
swift::SourceLoc(), nullptr, &m_source_file);
13461339
swift::Type underlying_type = GetSwiftType(type);
13471340
type_alias_decl->setUnderlyingType(underlying_type);
13481341
type_alias_decl->markAsDebuggerAlias(true);
1342+
type_alias_decl->setImplicit(true);
13491343

13501344
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
13511345
if (log) {

0 commit comments

Comments
 (0)