[SR-12415] 5.2 regression: Overload resolution for dynamicMemberLookup / dynamicCallable type fails #54854
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
swift 5.2
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
Target: x86_64-apple-darwin19.3.0
Additional Detail from JIRA
md5: f003a9c7f901c3a74533ee7961ed78c9
Issue Description:
The following (minimized) example fails to compile in the new 5.2 release, but worked fine in Swift 5.1:
In Swift 5.1, this would do a dynamic member lookup to find think, then call it dynamically with [arg:1]. In Swift 5.2, this finds the non-dynamic think method and tries to call that. It doesn't work because that method has no arguments.
The errors output are as follows:
The fact that this used to work is definitely a little odd, but it makes usecases like PythonKit much harder to use. In the code this example came from, Foo was PythonObject and think was a method called filter.
The workaround is to replace the
The text was updated successfully, but these errors were encountered: