[SR-13991] Generic return types can't be resolved when called as a function #56386
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Environment
Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)
Target: x86_64-apple-darwin20.2.0
Additional Detail from JIRA
md5: 3fb9705b5c40a279bdc4eb0e6544ce5a
Issue Description:
I was playing around with
@dynamicMemberLookup
, trying to implement a library version of something like C#'s built-indynamic
feature.It's a silly example, and I can't imagine myself using something like this in prod, but it seems like it should be possible, anyway.
The expression
x.f(10)
should have enough information for the generic return type to be inferred.It's known to be a function, because it's being called with
()
It's known to return an
Int
.It's known to have one parameter, which is an integer literal, which in the absence of other constraints should be inferred to
IntegerLiteralType
(Int
by default)The text was updated successfully, but these errors were encountered: