diff --git a/introduction.tex b/introduction.tex index 0eb855e..5830e64 100644 --- a/introduction.tex +++ b/introduction.tex @@ -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}}}$ +\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}}$