Skip to content

Surface errors in GetNumChildren. #8376

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 8 commits into from
Mar 13, 2024

Conversation

adrian-prantl
Copy link

This patch will allow displaying unresolved types in composite types
as errors instead of "{}" empty types.

rdar://123794838

adrian-prantl and others added 6 commits March 11, 2024 13:12
In the end this value comes from TypeSystem::GetNumChildren which
returns a uint32_t, so ValueObject should be consistent with that.

(cherry picked from commit 54c955b)
…int32_t

This way it is consistent with ValueObject and TypeSystem.

(cherry picked from commit 3d7c5b8)
…xpected (llvm#84219)

Change GetNumChildren()/CalculateNumChildren() methods return
llvm::Expected

This is an NFC change that does not yet add any error handling or change
any code to return any errors.

This is the second big change in the patch series started with
llvm#83501

A follow-up PR will wire up error handling.

(cherry picked from commit 624ea68)
This is a proof-of-concept patch that illustrates how to use the
Expected return values to surface rich error messages all the way up
to the ValueObjectPrinter.

This is the final patch in the series that includes
llvm#83501 and
llvm#84219

(cherry picked from commit 6462ead)
@adrian-prantl
Copy link
Author

@swift-ci test

This patch will allow displaying unresolved types in composite types
as errors instead of "{}" empty types.

rdar://123794838
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

1 similar comment
@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl adrian-prantl merged commit 5839da3 into swiftlang:stable/20230725 Mar 13, 2024
"TypeSystemSwiftTypeRef diverges from SwiftASTContext"); \
return IMPL(); \
} while (0)

#else
#define VALIDATE_AND_RETURN_STATIC(IMPL, REFERENCE) \
FALLBACK(REFERENCE, ()); \

Choose a reason for hiding this comment

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

This FALLBACK(REFERENCE, ()) has not been modified for the third parameter.

Also the one in line 2229 which I cannot leave a comment in.

One also need VALIDATE_AND_RETURN_EXPECTED equivalent in that #else branch.

Copy link
Author

Choose a reason for hiding this comment

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

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.

3 participants