From 947be154ea788f4d8b2cdc2bacc4c4d35ef32650 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Thu, 20 Mar 2014 02:42:44 +0100 Subject: [PATCH] Fehler behoben --- src/mycompiler/mystatement/LocalVarDecl.java | 11 ++-- .../test/lambda/testResults/LambdaTest.log | 66 +++++++++---------- test/plugindevelopment/FunNInsertTest.jav | 6 ++ 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/src/mycompiler/mystatement/LocalVarDecl.java b/src/mycompiler/mystatement/LocalVarDecl.java index d4502a16..3f5a6e08 100755 --- a/src/mycompiler/mystatement/LocalVarDecl.java +++ b/src/mycompiler/mystatement/LocalVarDecl.java @@ -67,9 +67,6 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.attribute.declid.25548.declaration private Vector declid = new Vector(); // ino.end - // ino.attribute.type.25551.declaration - private Type declType; - // ino.end // ino.attribute.paralist.25554.declaration private Vector paralist = null; // ino.end @@ -351,8 +348,8 @@ public class LocalVarDecl extends Statement implements TypeInsertable } if(e.getOldType().equals(this.getType())){ inferencelog.debug("Ersetze Typ in LocalVarDecl \""+this.get_Name()+"\"\n"); - if(declType instanceof TypePlaceholder){ - ((TypePlaceholder)declType).removeReplacementListener(this); + if(this.getType() instanceof TypePlaceholder){ + ((TypePlaceholder)this.getType()).removeReplacementListener(this); } this.setType(e.getNewType()); } @@ -416,8 +413,8 @@ public class LocalVarDecl extends Statement implements TypeInsertable // ino.end // ino.method.toString.25617.body { - if(declType == null)return "no type " + declid.toString(); - return declType.toString() + " " + declid.toString(); + if(this.getType() == null)return "no type " + declid.toString(); + return this.getType().toString() + " " + declid.toString(); } // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.25620.definition diff --git a/test/mycompiler/test/lambda/testResults/LambdaTest.log b/test/mycompiler/test/lambda/testResults/LambdaTest.log index c581c3b0..fe82ed39 100644 --- a/test/mycompiler/test/lambda/testResults/LambdaTest.log +++ b/test/mycompiler/test/lambda/testResults/LambdaTest.log @@ -1,7 +1,7 @@ Class DEBUG [Typeinference] Erstellte Assumptions: this: MatrixMethod Assumptions: [] FieldVar Assumptions: -[typinferenz.assumptions.FieldAssumption@4e64fca0, typinferenz.assumptions.FieldAssumption@48059495, typinferenz.assumptions.FieldAssumption@4e64fca0, typinferenz.assumptions.FieldAssumption@48059495] +[typinferenz.assumptions.FieldAssumption@4dd290b5, typinferenz.assumptions.FieldAssumption@3b1a82fd, typinferenz.assumptions.FieldAssumption@4dd290b5, typinferenz.assumptions.FieldAssumption@3b1a82fd] LocalVar Assumptions: [] Parameter Assumptions: @@ -9,26 +9,26 @@ Parameter Assumptions: Block DEBUG [Typeinference] Prozessing statement: null Return null (( [ f, ]) -> null { [null Return null (f.apply( [ null (this(null)), m, ]))]) Block DEBUG [Typeinference] Prozessing statement: null Return null (f.apply( [ null (this(null)), m, ])) -Block DEBUG [Typeinference] Prozessing statement: TPH BW Return TPH BS (f: TPH BQ.apply( [ Matrix (this(null)), m: TPH BO, ])) -Block DEBUG [Typeinference] Prozessing statement: TPH BX Return TPH BR (( [ TPH BQ f, ]) -> TPH BW { [TPH BW Return TPH BS (f: TPH BQ.apply( [ Matrix (this(null)), m: TPH BO, ]))]) -Class DEBUG [Typeinference] Erstellte Constraints: TPH BM < TPH BM -[[(TPH BT <. TPH BS), (Matrix <. TPH BU), (TPH BO <. TPH BV), (TPH BQ <. FunN), ]| ] -TPH BS < TPH BW -Fun1< TPH BW, TPH BQ > < TPH BR -TPH BR < TPH BX -Fun1< TPH BX, TPH BO > < TPH BP -TPH BP < TPH BM +Block DEBUG [Typeinference] Prozessing statement: TPH K Return TPH G (f: TPH E.apply( [ Matrix (this(null)), m: TPH C, ])) +Block DEBUG [Typeinference] Prozessing statement: TPH L Return TPH F (( [ TPH E f, ]) -> TPH K { [TPH K Return TPH G (f: TPH E.apply( [ Matrix (this(null)), m: TPH C, ]))]) +Class DEBUG [Typeinference] Erstellte Constraints: TPH A < TPH A +[[(TPH H <. TPH G), (Matrix <. TPH I), (TPH C <. TPH J), (TPH E <. FunN), ]| ] +TPH G < TPH K +Fun1< TPH K, TPH E > < TPH F +TPH F < TPH L +Fun1< TPH L, TPH C > < TPH D +TPH D < TPH A -SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH BM <. TPH BM), (TPH BT <. TPH BS), (Matrix <. TPH BU), (TPH BO <. TPH BV), (TPH BQ <. FunN), (TPH BS <. TPH BW), (Fun1< TPH BW, TPH BQ > <. TPH BR), (TPH BR <. TPH BX), (Fun1< TPH BX, TPH BO > <. TPH BP), (TPH BP <. TPH BM)]] -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Matrix), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)], [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< Vector< GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)], [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? extends Vector< GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)], [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)], [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? extends Vector< ? super GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)], [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? super Vector< GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)], [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? super Matrix >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)]] +SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH A <. TPH A), (TPH H <. TPH G), (Matrix <. TPH I), (TPH C <. TPH J), (TPH E <. FunN), (TPH G <. TPH K), (Fun1< TPH K, TPH E > <. TPH F), (TPH F <. TPH L), (Fun1< TPH L, TPH C > <. TPH D), (TPH D <. TPH A)]] +SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Matrix), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)], [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< Vector< GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)], [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? extends Vector< GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)], [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)], [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? extends Vector< ? super GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)], [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? super Vector< GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)], [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? super Matrix >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)]] SourceFile DEBUG [Typeinference] JavaFiles: -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Matrix), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Matrix), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)] -SourceFile DEBUG [Typeinference] class Matrix extends Vector> +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Fun1, BO> op = (BO m) -> { +Fun1, C> op = (C m) -> { return (FunN f) -> { return f.apply(this, m);; }; @@ -38,11 +38,11 @@ Matrix Matrix() } } -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< Vector< GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< Vector< GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)] -SourceFile DEBUG [Typeinference] class Matrix extends Vector> +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Fun1, BO> op = (BO m) -> { +Fun1, C> op = (C m) -> { return (FunN f) -> { return f.apply(this, m);; }; @@ -52,11 +52,11 @@ Matrix Matrix() } } -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? extends Vector< GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? extends Vector< GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)] -SourceFile DEBUG [Typeinference] class Matrix extends Vector> +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Fun1, BO> op = (BO m) -> { +Fun1, C> op = (C m) -> { return (FunN f) -> { return f.apply(this, m);; }; @@ -66,11 +66,11 @@ Matrix Matrix() } } -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)] -SourceFile DEBUG [Typeinference] class Matrix extends Vector> +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Fun1, BO> op = (BO m) -> { +Fun1, C> op = (C m) -> { return (FunN f) -> { return f.apply(this, m);; }; @@ -80,11 +80,11 @@ Matrix Matrix() } } -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? extends Vector< ? super GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? extends Vector< ? super GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)] -SourceFile DEBUG [Typeinference] class Matrix extends Vector> +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Fun1, BO> op = (BO m) -> { +Fun1, C> op = (C m) -> { return (FunN f) -> { return f.apply(this, m);; }; @@ -94,11 +94,11 @@ Matrix Matrix() } } -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? super Vector< GTV Integer > >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? super Vector< GTV Integer > >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)] -SourceFile DEBUG [Typeinference] class Matrix extends Vector> +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Fun1, BO> op = (BO m) -> { +Fun1, C> op = (C m) -> { return (FunN f) -> { return f.apply(this, m);; }; @@ -108,11 +108,11 @@ Matrix Matrix() } } -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH BT <. TPH BS), (TPH BO <. TPH BV), (TPH BS <. TPH BW), (TPH BX = Fun1< TPH BW, FunN >), (TPH BM = Fun1< Fun1< TPH BW, FunN >, TPH BO >), (TPH BU = Vector< ? super Matrix >), (TPH BQ = FunN), (TPH BR = Fun1< TPH BW, FunN >), (TPH BP = Fun1< Fun1< TPH BW, FunN >, TPH BO >)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH H <. TPH G), (TPH C <. TPH J), (TPH G <. TPH K), (TPH L = Fun1< TPH K, FunN >), (TPH A = Fun1< Fun1< TPH K, FunN >, TPH C >), (TPH I = Vector< ? super Matrix >), (TPH E = FunN), (TPH F = Fun1< TPH K, FunN >), (TPH D = Fun1< Fun1< TPH K, FunN >, TPH C >)] -SourceFile DEBUG [Typeinference] class Matrix extends Vector> +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Fun1, BO> op = (BO m) -> { +Fun1, C> op = (C m) -> { return (FunN f) -> { return f.apply(this, m);; }; diff --git a/test/plugindevelopment/FunNInsertTest.jav b/test/plugindevelopment/FunNInsertTest.jav index 1709ff2e..b2b38cbe 100644 --- a/test/plugindevelopment/FunNInsertTest.jav +++ b/test/plugindevelopment/FunNInsertTest.jav @@ -9,4 +9,10 @@ class FunNInsertTest{ var3 = c; }; + o2p = () -> (a, b, c) -> { + var1 = a; + var2 = b; + var3 = c; + }; + } \ No newline at end of file