From b1ce0f771b99b393cd6f6990bfc9da70b894deaa Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 6 Mar 2024 19:28:33 +0100 Subject: [PATCH] Comments to TI Capture Conversion --- introduction.tex | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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}}$