Skip to content

Commit ec51ed1

Browse files
committed
Correct rule about interfaces of bounded types
1 parent 73bfb1a commit ec51ed1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

specification/dartLangSpec.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5577,9 +5577,9 @@ \section{Interfaces}
55775577
(\ref{propertyExtraction}),
55785578
any type $T$ which is $T_0$ bounded
55795579
(\ref{typesBoundedByTypes}),
5580-
where $T_0$ is a class with interface $I$,
5580+
where $T_0$ is a type with interface $I$,
55815581
is also considered to have interface $I$.
5582-
Similarly, when $T$ is $T_0$ bounded where $T_0$ is a function type,
5582+
In particular, when $T$ is $T_0$ bounded where $T_0$ is a function type,
55835583
$T$ is considered to have a method named \CALL{} with signature $m$,
55845584
such that the function type of $m$ is $T_0$.
55855585

@@ -23642,8 +23642,10 @@ \subsection{Type Nullability}
2364223642
For example, even though \code{$e_1$.isEven} is allowed
2364323643
when the type of $e_1$ is \code{int},
2364423644
\code{$e_2$.isEven} is a compile-time error
23645-
when the type of $e_2$ is \code{int?}\ or
23646-
a type variable $X$ whose bound is \code{int?}.%
23645+
when the type of $e_2$ is \code{int?}.
23646+
It is also an error for a type variable $X$ whose bound is \code{int?},
23647+
because they have the same interface
23648+
(\ref{interfaces}).%
2364723649
}
2364823650

2364923651

0 commit comments

Comments
 (0)