[SR-10313] Segmentation Fault while using @dynamicCallable #52713
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
type checker
Area → compiler: Semantic analysis
Environment
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Target: x86_64-apple-darwin18.2.0
Xcode Version 10.2 (10E125)
macOS 10.14.3 (18D109)
Additional Detail from JIRA
md5: 9d6a9854497e423dedf8540a5d5fd3e6
Issue Description:
I tried to use dynamicCallable to make accessing values in a dictionary easier (seeing as subscripts still can't throw, and the subscript parameter can't be RawRepresentable where RawValue == String 🙁). I thought it was just meant to purely syntactic sugar (and that is why it works before you update to Swift 5), however it's clearly not as explained by the comment at near the end. If I remove the generic parameter and return something like String it works fine.
Here is the minimal code:
The compiler error is:
The text was updated successfully, but these errors were encountered: