Skip to content

Commit

Permalink
Reduce and add cross-refrence
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Jun 1, 2021
1 parent 220b345 commit da3187a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions chapters/interface.tex
Expand Up @@ -537,17 +537,9 @@ \section{Function-Compatibility or Function-Subtyping for Functions}\label{funct
constraining interface of the function being redeclared.
\end{itemize}

Note that variability of function calls cannot be determined using just the interface of a function, as the variabilities of default argument expressions are not expressed by the interface.
Note that variability of function calls, see \cref{function-variability}, cannot be determined using just the interface of a function, as the variabilities of default argument expressions are not expressed by the interface.
Hence a function redeclaration being function-compatible does not ensure that function calls will fulfill variability requirements, and tools must therefore check variability requirements separately.

\begin{nonnormative}
One way that tools may carry out the additional checks is to first infer the variability requirements on functions that can be redeclared, but looking at the expressions where the function is called.
The interface of the function that could be redeclared can then be extended with a variability requirement for any default argument expressions, allowing errors to be detected and reported at the point of a redeclaration that introduces too high variability through default argument expressions.
\end{nonnormative}
\begin{nonnormative}
Thus any call of a function that is replaceable will need to be checked after redeclarations.
\end{nonnormative}

\begin{example}
Demonstrating a redeclaration using a function-compatible function
\begin{lstlisting}[language=modelica]
Expand Down

0 comments on commit da3187a

Please sign in to comment.