You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manually writing out a RawRepresentable conformance has funny behavior, e.g. this works (as does adding typealias RawValue = String to the original code)
enumSecondEnum:RawRepresentable{case one
typealiasRawValue=StringvarrawValue:RawValue{return""}init?(rawValue:RawValue){fatalError()}init(rawValue:RawValue?){fatalError()}}
But these two (relying on associated type inference) don't:
enumSecondEnum:RawRepresentable{case one
varrawValue:String{return""}init?(rawValue:RawValue){fatalError()}init(rawValue:RawValue?){fatalError()}}// error: cannot invoke initializer for type 'SecondEnum' with an argument list of type '(rawValue: String?)'enumSecondEnum:RawRepresentable{case one
varrawValue:String{return""}init?(rawValue:String){fatalError()}init(rawValue:RawValue?){fatalError()}}// error: value of optional type 'String?' not unwrapped; did you mean to use '!' or '?'?
Attachment: Download
Environment
```
swiftc --version
Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
Target: x86_64-apple-macosx10.9
```
Additional Detail from JIRA
md5: 8ff64ffe67c51133465e3d6c3f6367e1
Parent-Task:
Issue Description:
This bug has a complicated set of prerequisites to produce.
swiftc -O -whole-module-optimization ProxyStruct.swift main.swift
The text was updated successfully, but these errors were encountered: