Comments to TI Capture Conversion
This commit is contained in:
parent
903b2405b1
commit
b1ce0f771b
@ -240,6 +240,21 @@ The method call \texttt{shuffle(l)} is not correct, because there is no solution
|
|||||||
|
|
||||||
$\exptype{List}{\wctype{\rwildcard{X}}{List}{\rwildcard{X}}} \lessdotCC \exptype{List}{\exptype{List}{\wtv{x}}}$
|
$\exptype{List}{\wctype{\rwildcard{X}}{List}{\rwildcard{X}}} \lessdotCC \exptype{List}{\exptype{List}{\wtv{x}}}$
|
||||||
|
|
||||||
|
\section{Type Inference for Capture Conversion}
|
||||||
|
why do we need a lessdotCC constraint
|
||||||
|
|
||||||
|
input is e.m(e);
|
||||||
|
Recap: TI for FGJ without Wildcards
|
||||||
|
- usually the type of e must be subtypes of the method parameters
|
||||||
|
- in case of a polymorphic method: type placeholders resemble type parameters
|
||||||
|
|
||||||
|
involving wildcards:
|
||||||
|
- depending on the type of e a capture conversion must be applied first
|
||||||
|
- the captured type N must be a subtype of the method parameters
|
||||||
|
- type parameters: can be set to free variables!
|
||||||
|
- but must afterwards be closed again
|
||||||
|
- the free variables can only be used inside the let statement
|
||||||
|
- we align the let statements in a way thate mimics Java capture conversion:
|
||||||
|
|
||||||
|
|
||||||
% $\exptype{List}{String} <: \wctype{\wildcard{X}{\bot}{\type{Object}}}{List}{\rwildcard{X}}$
|
% $\exptype{List}{String} <: \wctype{\wildcard{X}{\bot}{\type{Object}}}{List}{\rwildcard{X}}$
|
||||||
|
Loading…
Reference in New Issue
Block a user