Skip to content

Conversation

@adrian-prantl
Copy link

No description provided.

@adrian-prantl
Copy link
Author

@swift-ci test

Copy link

@kastiglione kastiglione left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where will this be used?

return name->getText().str();
}
std::string name;
llvm::raw_string_ostream(name) << idx;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the use case for returning the index if it has no name?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is needed by TypeSystemSwiftTypeRef::GetChildCompilerTypeAtIndex().
The implicit name of an unnamed tuple element is 0:, 1:, ... . See https://github.com/apple/llvm-project/blob/46170cc2f5a9af3db7652ef119ecee0dbc78392d/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp#L7018

bool print_help_if_available, bool print_extensions_if_available,
lldb::DescriptionLevel level = lldb::eDescriptionLevelFull) override;

/// Return the nth tuple element's name, if it has one.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Return the nth tuple element's name, if it has one.
/// Return the nth tuple element's name, or its index as a string if it has no name.

@adrian-prantl adrian-prantl merged commit c7692c0 into swiftlang:swift/main Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants