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
I made a result builder that turns key-value pairs into a dictionary. I'm getting a compiler exception when I build a test that uses that result builder in combination with a custom infix operator and a `try?` statement. Not an error message, just a long cryptic stack trace that is not my code. It's at the end of the description.
The Culprit:
The result builder works on the closure if I remove this line:
"number" => try? Int(bytes: [0, 0, 0])
Forcing using `try!` and wrapping as `(try? Int(bytes: [0, 0, 0]))!` also works.
Context
The => Operator
This is an operator that turns a String and TopLevelCodableValue into a DocumentKeyValuePair. These are custom types, you can find more in the project attached.
Attachment: Download
Additional Detail from JIRA
md5: 48e146170aff49e171450d7347d730c5
Issue Description:
I made a result builder that turns key-value pairs into a dictionary. I'm getting a compiler exception when I build a test that uses that result builder in combination with a custom infix operator and a `try?` statement. Not an error message, just a long cryptic stack trace that is not my code. It's at the end of the description.
The Culprit:
The result builder works on the closure if I remove this line:
Forcing using `try!` and wrapping as `(try? Int(bytes: [0, 0, 0]))!` also works.
Context
The => Operator
This is an operator that turns a
String
andTopLevelCodableValue
into aDocumentKeyValuePair
. These are custom types, you can find more in the project attached.This builds and works just fine in other result builder tests.
The Initializer
This initializer has the following signature:
It is used to initialize a value from a byte array.
The try? Result
Both
Int
andOptional<Int>
conform toTopLevelCodableValue
, so should build normally.The Error
The text was updated successfully, but these errors were encountered: