Skip to content

Commit 4c0656a

Browse files
authored
Generic method instantiation does not apply for the call of function objects (#1616)
Generic function instantiation was never intended to support function objects, it was only intended to be supported for terms that statically resolve to a function declaration. Similarly, generic method instantiation was only intended to be supported for property extractions that statically resolve to a generic method (so the signature was statically known, but the actual implementation was determined at run time). However, following the wording in the specification, the `call` method of a function type could be used to perform generic method instantiation on an arbitrary function object, which implied that generic function instantiation was supported for arbitrary functions after all. This PR changes the spec wording such that this (unintended) feature is no more specified to exist. There is no implementation work in the CFE, because the CFE always reported an error in this case. For the analyzer, see dart-lang/sdk#45936.
1 parent 88306bd commit 4c0656a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

specification/dartLangSpec.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14545,7 +14545,8 @@ \subsubsection{Generic Method Instantiation}
1454514545
Let $i$ be a property extraction expression of the form
1454614546
\code{$e$?.\id}, \code{$e$.\id}, or \code{\SUPER.\id}
1454714547
(\ref{propertyExtraction}, \ref{superGetterAccessAndMethodClosurization}),
14548-
which is statically resolved to denote an instance method named \id,
14548+
which is statically resolved to denote an instance method named \id{}
14549+
that is not the \CALL{} method of a function type,
1454914550
and let $G$ be the static type of $i$.
1455014551
Consider the situation where $G$ is a function type of the form
1455114552
\RawFunctionType{T_0}{X}{B}{s}{\metavar{parameters}}

0 commit comments

Comments
 (0)