Skip to content
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

Fixed a problem where code generation would fail for expressions containing an optional chain. #11

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

kishikawakatsumi
Copy link
Owner

Fixed a problem where code generation would fail for expressions containing an optional chain, like the following:

var c: SomeClass?
#expect(c?.property.performAction() == nil, verbose: true)

c = SomeClass()
#expect((c?.property.performAction())!, verbose: true)
#expect(c?.property.performAction() != nil, verbose: true)

let someDictionary = ["a": [1, 2, 3], "b": [10, 20]]
#expect(someDictionary["not here"]?[0] != 99, verbose: true)
#expect(someDictionary["a"]?[0] != 99, verbose: true)

@kishikawakatsumi kishikawakatsumi merged commit dec5c7d into main Apr 10, 2023
1 check passed
@kishikawakatsumi kishikawakatsumi deleted the optionalchaining branch April 10, 2023 08:44
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.

None yet

1 participant