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-1122] Failure to typecheck chain of binary operators on force-unwrapped values #43735

Closed
swift-ci opened this issue Apr 1, 2016 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself Linux Platform: Linux regression swift 3.0 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 1, 2016

Previous ID SR-1122
Radar rdar://problem/26731041
Original Reporter dmsilva (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a-ubuntu15.10
Swift 3.0-dev
Tested on Ubuntu 15.10.

And Swift 3.0 - Release

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.0Regression, Linux, TypeChecker
Assignee @jtbandes
Priority Medium

md5: 13d9bb7833934bcdea0929d92681e5b9

is duplicated by:

  • SR-3134 force-unwrapping fails mysteriously when interleaved with + operators
  • SR-2636 + Operator fails to infer type for more than 2 force unwrapped values
  • SR-3483 error: ambiguous reference to member '+'

Issue Description:

When trying to concatenate more than two strings in swift3 using the "!" symbol on each string, swift outputs an error. This used to work in swift 2.2.

When compiling this:

var a:String? = "a"
var b:String? = "b"
var c:String? = "c"
var d:String? = a! + b! + c!

I get the following error:

error: cannot convert value of type 'String' to specified type 'String?'
var d:String? = a! + b! + c!
                ~~~~~~~~^~~~

Here is the same example in the IBM sandbox

See the answer here on Stack Overflow for more details

@belkadan
Copy link
Contributor

Happens on OS X too on master.

@swift-ci
Copy link
Collaborator Author

Comment by Maximilian Hünenberger (JIRA)

This bug is still present in Swift 3.0 - Release

@jtbandes
Copy link
Collaborator

jtbandes commented Jan 4, 2017

Fixed in #6518

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself Linux Platform: Linux regression swift 3.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants