Skip to content

Commit f03027e

Browse files
committed
Integrated null-safety into the appendix about subtyping
1 parent 61da6d2 commit f03027e

File tree

2 files changed

+240
-155
lines changed

2 files changed

+240
-155
lines changed

specification/dart.sty

+15-12
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@
124124
\newenvironment{commentary}[1]{{\color{commentaryColor}\sf{#1}}}{}
125125

126126
% Auxiliary functions.
127-
\newcommand{\flattenName}{\mbox{\it flatten}}
127+
\newcommand{\flattenName}{\metavar{flatten}}
128128
\newcommand{\flatten}[1]{\ensuremath{\flattenName({#1})}}
129-
\newcommand{\futureOrBase}[1]{\ensuremath{\mbox{\it futureOrBase}({#1})}}
130-
\newcommand{\overrides}[1]{\ensuremath{\mbox{\it overrides}({#1})}}
131-
\newcommand{\inherited}[1]{\ensuremath{\mbox{\it inherited}({#1})}}
129+
\newcommand{\futureOrBase}[1]{\ensuremath{\metavar{futureOrBase}({#1})}}
130+
\newcommand{\overrides}[1]{\ensuremath{\metavar{overrides}({#1})}}
131+
\newcommand{\inherited}[1]{\ensuremath{\metavar{inherited}({#1})}}
132132

133133
% Used as a mini-section marker, indicating visibly that a range of
134134
% text (usually just a couple of paragraphs) are concerned with one
@@ -200,7 +200,11 @@
200200

201201
% Mark a compile-time error in the margin.
202202
\newcommand{\Error}[1]{%
203-
\leavevmode\marginpar{\ensuremath{_{^\ominus}}}{#1}}
203+
\leavevmode\marginpar{\ensuremath{_{\textcolor{red}{^\ominus}}}}{#1}}
204+
205+
% Mark a dynamic error in the margin.
206+
\newcommand{\DynamicError}[1]{%
207+
\leavevmode\marginpar{\textcolor{red}{\Lightning}}{#1}}
204208

205209
% Used to specify comma separated lists of similar symbols.
206210
\newcommand{\List}[3]{\ensuremath{{#1}_{#2},\,\ldots,\ {#1}_{#3}}}
@@ -402,9 +406,9 @@
402406

403407
% Same as \FunctionTypeNamed except suitable for inline usage, hence omitting
404408
% the spacer argument.
405-
\newcommand{\RawFunctionTypeNamed}[8]{%
409+
\newcommand{\RawFunctionTypeNamed}[9]{%
406410
\RawFunctionType{#1}{#2}{#3}{#4}{%
407-
\FunctionTypeNamedParameters{#5}{#6}{#7}{#8}{r}}}
411+
\FunctionTypeNamedParameters{#5}{#6}{#7}{#8}{#9}}}
408412

409413
% A variant of \FunctionTypeNamed that uses the standard symbols,
410414
% that is, a function type with positional optional parameters which
@@ -471,11 +475,10 @@
471475
\newcommand{\Supertype}[3]{\ensuremath{{#1}\vdash{#2}\,:>\,{#3}}}
472476
\newcommand{\SupertypeStd}[2]{\Supertype{\Delta}{#1}{#2}}
473477

474-
% Judgment expressing that an assignability relation exists.
475-
\newcommand{\AssignableRelationSymbol}{\ensuremath{\Longleftrightarrow}}
476-
\newcommand{\Assignable}[3]{%
477-
\ensuremath{{#1}\vdash{#2}\,\AssignableRelationSymbol\,{#3}}}
478-
\newcommand{\AssignableStd}[2]{\Assignable{\Gamma}{#1}{#2}}
478+
% Judgment expressing that a subtype and a supertype relation exist.
479+
\newcommand{\MutualSubtype}[3]{\ensuremath{{#1}\vdash{#2}\,<:>\,{#3}}}
480+
\newcommand{\MutualSubtypeStd}[2]{\MutualSubtype{\Delta}{#1}{#2}}
481+
\newcommand{\MutualSubtypeNE}[2]{\ensuremath{{#1}\,<:>\,{#2}}}
479482

480483
% Semantic function delivering the superinterfaces of a class.
481484
\newcommand{\Superinterfaces}[1]{\ensuremath{\metavar{Superinterfaces}({#1})}}

0 commit comments

Comments
 (0)