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

[SR-13258] Conditional binding compiles successfully without optional type #55698

Closed
zienag opened this issue Jul 20, 2020 · 3 comments
Closed
Labels
accepts invalid Bug: Accepts invalid bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@zienag
Copy link

zienag commented Jul 20, 2020

Previous ID SR-13258
Radar None
Original Reporter @zienag
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 12 beta 2, beta 1.
Works as expected in Xcode 11.5

Additional Detail from JIRA
Votes 3
Component/s Compiler
Labels Bug, AcceptsInvalid, TypeChecker
Assignee None
Priority Medium

md5: 5b28d669d0ca987c42d8e004109f10d7

Issue Description:

Code to reproduce:

let a = 1
let b = Int?(nil)
if let c = b ?? a { print(c) }

Extracting nil-coalescing expression to another variable helps.

@theblixguy
Copy link
Collaborator

I can reproduce this on Xcode 12 beta 1, but not on master. It looks like this has been fixed.

@theblixguy
Copy link
Collaborator

I've added a regression test to make sure we catch this if it happens again: #33000

@CodaFi
Copy link
Member

CodaFi commented Jul 21, 2020

I fixed this a while ago in #31760

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts invalid Bug: Accepts invalid bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants