Skip to content

Swift: Fix type string representation #19582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged

Conversation

jketema
Copy link
Contributor

@jketema jketema commented May 26, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 26, 2025 14:23
@jketema jketema requested a review from a team as a code owner May 26, 2025 14:23
@github-actions github-actions bot added the Swift label May 26, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes the string representation of Swift TypeValueExpr by guarding the call to fetchLabel and passing both the syntax and resolved type when available.

  • Added checks for getParamTypeRepr() and getParamType()
  • Updated fetchLabel to accept both the TypeRepr and the Type
  • Removed the unconditional single-argument call
Comments suppressed due to low confidence (1)

swift/extractor/translators/ExprTranslator.cpp:694

  • Add unit tests covering scenarios where getParamTypeRepr() or getParamType() is null to ensure the new conditional logic behaves as expected and avoids regressions.
if (expr.getParamTypeRepr() && expr.getParamType()) {

Copy link
Contributor

@redsun82 redsun82 left a comment

Choose a reason for hiding this comment

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

Thanks!

@jketema jketema merged commit 0f2d2b7 into github:main May 27, 2025
15 checks passed
@jketema jketema deleted the jketema/swift-type branch May 27, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants