Skip to content

Commit

Permalink
Allow extends from empty base-class and define empty class.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Apr 5, 2023
1 parent 87e4b34 commit efe024c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion chapters/classes.tex
Expand Up @@ -843,7 +843,7 @@ \subsection{Short Class Definitions}\label{short-class-definitions}

\subsection{Combining Base Classes and Other Elements}\label{restriction-on-combining-base-classes-and-other-elements}\label{combining-base-classes-and-other-elements}

It is not legal to combine equations, algorithms, components, base classes, or protected elements with an extends from an array class, a class with non-empty \lstinline[language=grammar]!base-prefix!, a \firstuse{simple type} (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types), or any class transitively extending from an array class, a class with non-empty \lstinline[language=grammar]!base-prefix!, or a simple type.
It is not legal to combine equations, algorithms, components, non-empty base classes (see \cref{empty-class}), or protected elements with an extends from an array class, a class with non-empty \lstinline[language=grammar]!base-prefix!, a \firstuse{simple type} (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types), or any class transitively extending from an array class, a class with non-empty \lstinline[language=grammar]!base-prefix!, or a simple type.

\begin{example}
\begin{lstlisting}[language=modelica]
Expand Down Expand Up @@ -893,6 +893,11 @@ \subsection{Local Class Definitions -- Nested Classes}\label{local-class-definit
The variables \lstinline!v1! and \lstinline!v2! are instances of this local class and thus have a nominal value of 1000.
\end{example}

\subsection{Empty Class}\label{empty-class}
An empty class is a class without equations, algorithms, and components, and where any base-classes are themselves empty.

They may contain graphics - and can be used more freely as base-classes than other classes.

\section{Specialized Classes}\label{specialized-classes}

Specialized kinds of classes\index{specialized class} (earlier known as \emph{restricted classes}\index{restricted class|see{specialized class}})
Expand Down
2 changes: 1 addition & 1 deletion chapters/functions.tex
Expand Up @@ -2824,7 +2824,7 @@ \subsection{External Objects}\label{external-objects}
\item
An external object class shall be of the specialized class {\lstinline!class!}.
\begin{nonnormative}
This is the only use of {\lstinline!class!}.
This is the only use of {\lstinline!class!} for a non-empty class, \cref{empty-class}.
\end{nonnormative}
\item
Classes derived from {\lstinline!ExternalObject!} can neither be used in an {\lstinline!extends!}-clause nor in a short class definition.
Expand Down

0 comments on commit efe024c

Please sign in to comment.