dc.rights.license | CC-BY-NC-ND | |
dc.contributor.advisor | Swierstra, W.S. | |
dc.contributor.author | Demitraszek, Maksymilian | |
dc.date.accessioned | 2024-09-12T23:03:34Z | |
dc.date.available | 2024-09-12T23:03:34Z | |
dc.date.issued | 2024 | |
dc.identifier.uri | https://studenttheses.uu.nl/handle/20.500.12932/47762 | |
dc.description.abstract | The type inference in statically typed, object-oriented languages is local because it needs to know the type of an object when a method is called or a property accessed on it, as multiple classes can implement the method/parameter with the same name. This is necessary to determine the type of the method/parameter. We introduce a language Inferable Featherweight Java (IFJ) which models statically typed, object-oriented programs with type information inferred partially. We define the type inference progression property for IFJ programs. If a program holds this property it has sufficient information inferred, so the type inference algorithm can determine all types of methods/parameters. We prove that type variables substituting phantom type parameters and type parameters used only on contravariant positions do not have to be inferred for a program to hold this property. Furthermore, we use this result to extend the reference type inference algorithm based on the programming language Kotlin, so it does not fail if unable to infer certain type variables based only on the local context. We consolidate those results as a feature proposal for the programming language Kotlin and integrate it partially into Kotlin's compiler. The new type inference algorithm allows certain type annotations to be left out in programs, most notably when working with algebraic data types. | |
dc.description.sponsorship | Utrecht University | |
dc.language.iso | EN | |
dc.subject | We introduce a language Inferable Featherweight Java (IFJ) which models programs with type information inferred partially. We define the type inference progression property for IFJ programs. We prove that type variables substituting phantom type parameters and type parameters used only on contravariant positions do not have to be inferred for a program to hold this property. Furthermore, we use this result to extend the reference type inference algorithm based on the programming language Kotlin. | |
dc.title | Not Too Local type inference | |
dc.type.content | Master Thesis | |
dc.rights.accessrights | Open Access | |
dc.subject.courseuu | Computing Science | |
dc.thesis.id | 39250 | |