From 4046066b7ccdef28fc615f5b176f2844d394ab5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Fri, 5 Dec 2014 17:25:46 +0100 Subject: [PATCH] Wildcards im Subst im Unify eingefuegt --- .classpath | 2 +- bin/.gitignore | 2 +- .../typeinference/unify/Unify.java | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.classpath b/.classpath index 8031ed71f..8ed570226 100755 --- a/.classpath +++ b/.classpath @@ -3,7 +3,7 @@ - + diff --git a/bin/.gitignore b/bin/.gitignore index 56a30e6a4..ba369ba7b 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,6 +1,6 @@ -/bytecode/ /de/ /mycompiler/ /parser/ /plugindevelopment/ /syntaxTree/ +/bytecode/ diff --git a/src/de/dhbwstuttgart/typeinference/unify/Unify.java b/src/de/dhbwstuttgart/typeinference/unify/Unify.java index d3408e028..3c2814077 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/Unify.java +++ b/src/de/dhbwstuttgart/typeinference/unify/Unify.java @@ -2400,6 +2400,36 @@ throws MatchException return true; } } + //Wildcard ergänzt PL 12-12-05 + if ( T instanceof ExtendsWildcardType ) + { + Type Temp = ((ExtendsWildcardType) T).get_ExtendsType(); + if( Temp instanceof TypePlaceholder ) + { + + if( Temp.getName().equals(a.getName()) ) + { + // Typvariable ersetzen + ((ExtendsWildcardType) T).SetWildcardType(o); + return true; + } + } + } + + if ( T instanceof SuperWildcardType ) + { + Type Temp = ((SuperWildcardType) T).get_SuperType(); + if( Temp instanceof TypePlaceholder ) + { + + if( Temp.getName().equals(a.getName()) ) + { + // Typvariable ersetzen + ((SuperWildcardType) T).SetWildcardType(o); + return true; + } + } + } return false; } // ino.end