Skip to content

[Compile Time Constant Extraction] Extract Nil Values for Optionals #78511

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

Conversation

venkatesh5789
Copy link
Contributor

@venkatesh5789 venkatesh5789 commented Jan 9, 2025

Added support for extracting nil values from undeclared optionals or optionals explicitly declared as nil.

Example:

public struct Bools : MyProto {
    let bool1: Bool? = nil
    var string1: String?
}

In this case, both bool1 and string1 would have "valueKind": "NilLiteral"

Resolves rdar://132918028

@venkatesh5789 venkatesh5789 requested review from artemcm and jPaolantonio and removed request for xedin, slavapestov and hborla January 9, 2025 07:52
@venkatesh5789 venkatesh5789 force-pushed the null-value-optional-extraction branch 3 times, most recently from 23e50a1 to 1409c28 Compare January 9, 2025 08:55
@venkatesh5789
Copy link
Contributor Author

@swift-ci test

@venkatesh5789
Copy link
Contributor Author

@swift-ci test macOS

@venkatesh5789
Copy link
Contributor Author

@swift-ci smoke test macOS

@venkatesh5789 venkatesh5789 force-pushed the null-value-optional-extraction branch from cc6417f to c6c8526 Compare January 16, 2025 06:34
@venkatesh5789
Copy link
Contributor Author

@swift-ci test

@venkatesh5789 venkatesh5789 merged commit a5cc53f into swiftlang:main Jan 16, 2025
5 checks passed
jPaolantonio added a commit that referenced this pull request Jul 8, 2025
…iteral (#82339)

This was missed in #78511.

Resolves rdar://153563086

Co-authored-by: James Paolantonio <[email protected]>
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