Skip to content

Commit f86568f

Browse files
authored
Add two paragraphs (and a bit of commentary) about canonicalization of constant functions (#1686)
This PR adds a couple of paragraphs to the language specification, specifying that constant expressions whose evaluation is a function closurization or a generic function instantiation are canonicalized.
1 parent 60db11d commit f86568f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

specification/dartLangSpec.tex

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12846,6 +12846,17 @@ \subsection{Function Closurization}
1284612846
(\ref{statementCompletion})
1284712847
as the invocation of $f$ would have yielded.
1284812848

12849+
\LMHash{}%
12850+
Let $e_1$ and $e_2$ be two constant expressions that both
12851+
evaluate to a function object which is obtained by function closurization
12852+
of the same function declaration.
12853+
In this case \code{identical($e_1$, $e_2$)} shall evaluate to true.
12854+
12855+
\commentary{%
12856+
That is, constant expressions whose evaluation is a function closurization
12857+
are canonicalized.%
12858+
}
12859+
1284912860

1285012861
\subsubsection{Generic Function Instantiation}
1285112862
\LMLabel{genericFunctionInstantiation}
@@ -13058,6 +13069,20 @@ \subsubsection{Generic Function Instantiation}
1305813069
}
1305913070
\EndCase
1306013071

13072+
\LMHash{}%
13073+
Let $e_1$ and $e_2$ be two constant expressions that both
13074+
evaluate to a function object
13075+
which is obtained by generic function instantiation
13076+
of the same function declaration
13077+
and with the same type arguments.
13078+
In this case \code{identical($e_1$, $e_2$)} shall evaluate to true.
13079+
13080+
\commentary{%
13081+
That is, constant expressions whose evaluation is
13082+
a generic function instantiation
13083+
are canonicalized.%
13084+
}
13085+
1306113086

1306213087
\subsection{Lookup}
1306313088
\LMLabel{lookup}

0 commit comments

Comments
 (0)