nice-commit Mailing List for The Nice Programming Language (Page 93)
Brought to you by:
bonniot
You can subscribe to this list here.
2003 |
Jan
|
Feb
(60) |
Mar
(125) |
Apr
(183) |
May
(140) |
Jun
(227) |
Jul
(141) |
Aug
(181) |
Sep
(75) |
Oct
(89) |
Nov
(187) |
Dec
(162) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(69) |
Feb
(197) |
Mar
(98) |
Apr
(26) |
May
(10) |
Jun
(85) |
Jul
(88) |
Aug
(79) |
Sep
(80) |
Oct
(81) |
Nov
(53) |
Dec
(109) |
2005 |
Jan
(68) |
Feb
(77) |
Mar
(232) |
Apr
(79) |
May
(37) |
Jun
(37) |
Jul
(3) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(9) |
2007 |
Jan
(2) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(17) |
Dec
(6) |
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ar...@us...> - 2003-07-27 13:28:53
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv26481/F:/nice/src/bossa/syntax Modified Files: MethodBodyDefinition.java Log Message: Changed printed type of method arguments. Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** MethodBodyDefinition.java 26 Jul 2003 22:02:01 -0000 1.136 --- MethodBodyDefinition.java 27 Jul 2003 13:28:49 -0000 1.137 *************** *** 118,124 **** if (p.name == null) // anonymous pattern ! type = new MonotypeVar("anonymous argument " + tn); else ! type = new MonotypeVar("type(" + p.name + ")<" + types[tn]); } --- 118,124 ---- if (p.name == null) // anonymous pattern ! type = new MonotypeVar(types[tn].toString()+ "(argument_" + tn+")"); else ! type = new MonotypeVar(types[tn].toString()+ "(" + p.name + ")"); } |
Update of /cvsroot/nice/Nice/testsuite/compiler/designByContract In directory sc8-pr-cvs1:/tmp/cvs-serv21336/F:/nice/testsuite/compiler/designByContract Modified Files: classFunctions.testsuite classMethods.testsuite functions.testsuite methods.testsuite Log Message: Improved locations of some expression. Index: classFunctions.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/designByContract/classFunctions.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** classFunctions.testsuite 12 Nov 2002 15:06:28 -0000 1.1 --- classFunctions.testsuite 27 Jul 2003 13:14:44 -0000 1.2 *************** *** 73,77 **** /// Toplevel class A { ! int f() ensures ((/*/// FAIL HERE */ result = 0) == 0) = 1; } --- 73,77 ---- /// Toplevel class A { ! int f() ensures (/*/// FAIL HERE */(result = 0) == 0) = 1; } Index: classMethods.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/designByContract/classMethods.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** classMethods.testsuite 12 Nov 2002 15:06:28 -0000 1.1 --- classMethods.testsuite 27 Jul 2003 13:14:44 -0000 1.2 *************** *** 80,84 **** /// Toplevel class A { ! int f() ensures ((/*/// FAIL HERE */ result = 0) == 0); f() = 1; --- 80,84 ---- /// Toplevel class A { ! int f() ensures (/*/// FAIL HERE */(result = 0) == 0); f() = 1; Index: functions.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/designByContract/functions.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.testsuite 12 Nov 2002 15:06:28 -0000 1.3 --- functions.testsuite 27 Jul 2003 13:14:44 -0000 1.4 *************** *** 58,61 **** /// FAIL /// Toplevel ! int f() ensures ((/*/// FAIL HERE */ result = 0) == 0) = 1; --- 58,61 ---- /// FAIL /// Toplevel ! int f() ensures (/*/// FAIL HERE */(result = 0) == 0) = 1; Index: methods.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/designByContract/methods.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** methods.testsuite 12 Nov 2002 15:06:28 -0000 1.3 --- methods.testsuite 27 Jul 2003 13:14:44 -0000 1.4 *************** *** 65,69 **** /// FAIL /// Toplevel ! int f() ensures ((/*/// FAIL HERE */ result = 0) == 0); f() = 1; --- 65,69 ---- /// FAIL /// Toplevel ! int f() ensures (/*/// FAIL HERE */(result = 0) == 0); f() = 1; |
From: <ar...@us...> - 2003-07-27 13:14:47
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv21336/F:/nice/src/bossa/syntax Modified Files: analyse.nice Log Message: Improved locations of some expression. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** analyse.nice 26 Jul 2003 22:02:01 -0000 1.75 --- analyse.nice 27 Jul 2003 13:14:44 -0000 1.76 *************** *** 443,450 **** if (sym.isFieldAccess() && Node.thisExp != null) ! return new CallExp ! (newOverloadedSymbolExp(symbols, e.ident), ! new Arguments([new Arguments.Argument(Node.thisExp)])); ! return new SymbolExp(sym, e.location()); } --- 443,453 ---- if (sym.isFieldAccess() && Node.thisExp != null) ! { ! CallExp res = new CallExp ! (newOverloadedSymbolExp(symbols, e.ident), ! new Arguments([new Arguments.Argument(Node.thisExp)])); ! res.setLocation(e.location()); ! return res; ! } return new SymbolExp(sym, e.location()); } |
From: <ar...@us...> - 2003-07-27 13:14:47
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv21336/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Improved locations of some expression. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.200 retrieving revision 1.201 diff -C2 -d -r1.200 -r1.201 *** Parser.jj 25 Jul 2003 17:00:21 -0000 1.200 --- Parser.jj 27 Jul 2003 13:14:44 -0000 1.201 *************** *** 1986,1994 **** Expression PrimaryExpression() : ! { Expression res; } { res=PrimaryPrefix() ( LOOKAHEAD(2) res=PrimarySuffix(res) )* ! { return res; } } --- 1986,1995 ---- Expression PrimaryExpression() : ! { Expression res; Token first = getToken(1);} { res=PrimaryPrefix() ( LOOKAHEAD(2) res=PrimarySuffix(res) )* ! { res.setLocation(Location.make(first, getToken(0))); ! return res; } } |
From: <bo...@us...> - 2003-07-26 22:30:42
|
Update of /cvsroot/nice/Nice/testsuite/compiler/overloading In directory sc8-pr-cvs1:/tmp/cvs-serv25530/testsuite/compiler/overloading Modified Files: fields.testsuite Log Message: Implicit access to a field without 'this' inside an initializer, in presence of overloading. Index: fields.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/overloading/fields.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fields.testsuite 27 May 2003 12:40:08 -0000 1.1 --- fields.testsuite 26 Jul 2003 22:30:39 -0000 1.2 *************** *** 98,99 **** --- 98,110 ---- int x = 0; } + + /// PASS + /// Toplevel + class A + { + boolean foo; + // Initializer + { boolean b = false || foo; } + } + int foo() = 42; + |
From: <bo...@us...> - 2003-07-26 22:29:51
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv25333/src/bossa/syntax Modified Files: VarSymbol.java PolySymbol.java OverloadedSymbolExp.java MonoSymbol.java Log Message: When a default value is used in a method call, use the declared type of that parameter to compute the resulting type. Index: VarSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarSymbol.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** VarSymbol.java 25 Jul 2003 16:59:24 -0000 1.32 --- VarSymbol.java 26 Jul 2003 22:29:47 -0000 1.33 *************** *** 118,126 **** // explained in OverloadedSymbolExp ! /** @param argTypes some types can contain unquantified occurences ! of the type parameters of this symbol, in which case they must be ! cloned too to keep the relationship. */ ! abstract void makeClonedType(Polytype[] argTypes); abstract void releaseClonedType(); abstract Polytype getClonedType(); --- 118,127 ---- // explained in OverloadedSymbolExp ! /** @param argTypes types of the arguments used in the call to this ! symbol. ! @param used default values were used at those indexes where ! the value in this array is 0. */ ! abstract void makeClonedType(Polytype[] argTypes, int[] used); abstract void releaseClonedType(); abstract Polytype getClonedType(); Index: PolySymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/PolySymbol.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PolySymbol.java 25 Jul 2003 16:59:24 -0000 1.14 --- PolySymbol.java 26 Jul 2003 22:29:47 -0000 1.15 *************** *** 14,17 **** --- 14,18 ---- import mlsub.typing.Polytype; + import nice.tools.code.Types; import bossa.util.*; *************** *** 69,88 **** private Polytype clonedType; ! final void makeClonedType(Polytype[] argTypes) { ! if(clonedType != null) Internal.error(this, "clonedType in use"); ! java.util.Map map = type.getCloningMap(); ! if (map == null) ! { ! clonedType = type; ! return; ! } ! clonedType = type.cloneType(map); ! if (argTypes != null) ! for (int i = 0; i < argTypes.length; i++) ! argTypes[i] = argTypes[i].applyMap(map); } --- 70,99 ---- private Polytype clonedType; ! final void makeClonedType(Polytype[] argTypes, int[] used) { ! if (clonedType != null) Internal.error(this, "clonedType in use"); ! clonedType = type.cloneType(); ! /* Where a default value was used, use the declared argument type instead ! of the value's type. This is more robust, as the application type will ! not depend on the default value. ! Furthermore, this avoids running into problems when the default value ! refers to type parameters (in anonymous functions, by refering to ! previous arguments, ...) which would not be in sync with the cloned ! ones. ! This is only needed when the type is polymorphic. ! */ ! ! if (clonedType == type || argTypes == null || used == null) ! return; ! ! mlsub.typing.Monotype fun = Types.rawType(clonedType.getMonotype()); ! mlsub.typing.Monotype[] domain = ((mlsub.typing.FunType) fun).domain(); ! ! for (int i = 0; i < argTypes.length; i++) ! if (used[i] == 0) ! argTypes[i] = new Polytype(domain[i]); } Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** OverloadedSymbolExp.java 26 Jul 2003 22:02:01 -0000 1.57 --- OverloadedSymbolExp.java 26 Jul 2003 22:29:47 -0000 1.58 *************** *** 143,147 **** // and we check that cloneType() is not called twice // before the clone type is released ! s.makeClonedType(argsType); Polytype t = CallExp.wellTyped(s.getClonedType(), argsType); --- 143,147 ---- // and we check that cloneType() is not called twice // before the clone type is released ! s.makeClonedType(argsType, arguments.getUsedArguments(s)); Polytype t = CallExp.wellTyped(s.getClonedType(), argsType); *************** *** 202,206 **** { VarSymbol s = (VarSymbol) i.next(); ! s.makeClonedType(null); try{ Typing.leq(s.getClonedType(), expectedType); --- 202,206 ---- { VarSymbol s = (VarSymbol) i.next(); ! s.makeClonedType(null, null); try{ Typing.leq(s.getClonedType(), expectedType); Index: MonoSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MonoSymbol.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MonoSymbol.java 25 Jul 2003 16:59:24 -0000 1.21 --- MonoSymbol.java 26 Jul 2003 22:29:47 -0000 1.22 *************** *** 141,145 **** // explained in OverloadedSymbolExp ! final void makeClonedType(Polytype[] argTypes) {} final void releaseClonedType() {} --- 141,145 ---- // explained in OverloadedSymbolExp ! final void makeClonedType(Polytype[] argTypes, int[] used) {} final void releaseClonedType() {} |
From: <bo...@us...> - 2003-07-26 22:29:50
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1:/tmp/cvs-serv25333/src/mlsub/typing Modified Files: Polytype.java Log Message: When a default value is used in a method call, use the declared type of that parameter to compute the resulting type. Index: Polytype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Polytype.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Polytype.java 25 Jul 2003 16:59:23 -0000 1.18 --- Polytype.java 26 Jul 2003 22:29:47 -0000 1.19 *************** *** 49,70 **** public Polytype cloneType() { - Map map = getCloningMap(); - if (map == null) - return this; - else - return cloneType(map); - } - - public Map getCloningMap() - { //Optimization if (isMonomorphic()) ! return null; ! return new java.util.HashMap(); ! } - public Polytype cloneType(Map map) - { TypeSymbol[] binders = constraint.binders(); TypeSymbol[] newBinders = new TypeSymbol[binders.length]; --- 49,58 ---- public Polytype cloneType() { //Optimization if (isMonomorphic()) ! return this; ! Map map = new java.util.HashMap(); TypeSymbol[] binders = constraint.binders(); TypeSymbol[] newBinders = new TypeSymbol[binders.length]; *************** *** 79,91 **** (new Constraint(newBinders, AtomicConstraint.substitute(map, constraint.atoms())), - monotype.substitute(map)); - } - - public Polytype applyMap(Map map) - { - return new Polytype - (isMonomorphic() ? Constraint.True - : new Constraint(constraint.binders(), - AtomicConstraint.substitute(map, constraint.atoms())), monotype.substitute(map)); } --- 67,70 ---- |
From: <bo...@us...> - 2003-07-26 22:29:50
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv25333/testsuite/compiler/classes Modified Files: typeParameters.testsuite Log Message: When a default value is used in a method call, use the declared type of that parameter to compute the resulting type. Index: typeParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/typeParameters.testsuite,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** typeParameters.testsuite 25 Jul 2003 16:59:23 -0000 1.12 --- typeParameters.testsuite 26 Jul 2003 22:29:47 -0000 1.13 *************** *** 224,225 **** --- 224,265 ---- Impl<int> w = new Impl(); } + + /// PASS + /// Toplevel + class Bar<U> { + U e; + } + class II<T> { + private Bar<T> lp; + void foo(T element) { + this.lp = new Bar(e: element); + } + } + + /// PASS + /// Toplevel + interface A<T> {} + interface C<T> {} + class CImpl<T> extends Impl<T> implements C<T> {} + class Impl<T> { + T -> int bar = T t1 => 0; + } + class Foo<T> { + Impl<int> w = new Impl(); // works + Impl<A<int>> s = new Impl(); // works + C<A<T>> t = new CImpl(); // does not work! + } + + /// PASS + new B(); + /// Toplevel + class A<T> { T->T f = T x => { T tmp = x; return tmp; }; } + class B<T> extends A<T> {} + + /// PASS + /// Toplevel + class Foo<T> { + T t; + + { t = t; this.t = t; t = this.t; this.t = this.t; } + } |
From: <bo...@us...> - 2003-07-26 22:29:50
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv25333/testsuite/compiler/typing Modified Files: optionalParameters.testsuite Log Message: When a default value is used in a method call, use the declared type of that parameter to compute the resulting type. Index: optionalParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/optionalParameters.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** optionalParameters.testsuite 25 Jul 2003 16:59:23 -0000 1.1 --- optionalParameters.testsuite 26 Jul 2003 22:29:47 -0000 1.2 *************** *** 6,7 **** --- 6,11 ---- int->int f = foo(); } + + /// PASS + /// Toplevel + <X> boolean f(X x, X->boolean c = X y => x == y) = c(x); |
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv20817/src/bossa/syntax Modified Files: analyse.nice ToplevelFunction.java OverloadedSymbolExp.java NiceFieldAccess.java NiceClass.java MethodBodyDefinition.java FormalParameters.java Log Message: Reimplemented field access with implicit 'this', without using the special ThisParameter (similar to default value of field accesses). Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** analyse.nice 24 Jun 2003 15:28:19 -0000 1.74 --- analyse.nice 26 Jul 2003 22:02:01 -0000 1.75 *************** *** 442,448 **** } ! if (sym.isFieldAccess()) ! return new CallExp(newOverloadedSymbolExp(symbols, e.ident), ! Arguments.noArguments()); return new SymbolExp(sym, e.location()); --- 442,449 ---- } ! if (sym.isFieldAccess() && Node.thisExp != null) ! return new CallExp ! (newOverloadedSymbolExp(symbols, e.ident), ! new Arguments([new Arguments.Argument(Node.thisExp)])); return new SymbolExp(sym, e.location()); Index: ToplevelFunction.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ToplevelFunction.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ToplevelFunction.java 28 May 2003 12:57:26 -0000 1.17 --- ToplevelFunction.java 26 Jul 2003 22:02:01 -0000 1.18 *************** *** 84,88 **** { if (body != null) ! body = dispatch.analyse(body, thisScope, thisTypeScope, !voidReturn); } --- 84,98 ---- { if (body != null) ! { ! if (parameters.hasThis()) ! Node.thisExp = new SymbolExp(getSymbols()[0], location()); ! ! try { ! body = dispatch.analyse(body, thisScope, thisTypeScope, !voidReturn); ! } ! finally { ! Node.thisExp = null; ! } ! } } Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** OverloadedSymbolExp.java 25 Jul 2003 16:59:24 -0000 1.56 --- OverloadedSymbolExp.java 26 Jul 2003 22:02:01 -0000 1.57 *************** *** 262,273 **** { if (fieldAccesses.size() != 0) ! try { ! CallExp res = new CallExp ! (new OverloadedSymbolExp(fieldAccesses, ident), ! Arguments.noArguments()); ! res.resolveOverloading(); ! return res; ! } ! catch (UserError e) { symbols.removeAll(filterFieldAccesses()); --- 262,278 ---- { if (fieldAccesses.size() != 0) ! { ! if (Node.thisExp != null) ! try { ! CallExp res = new CallExp ! (new OverloadedSymbolExp(fieldAccesses, ident), ! //Arguments.noArguments()); ! new Arguments(new Arguments.Argument[]{new Arguments.Argument(Node.thisExp)})); ! ! res.resolveOverloading(); ! return res; ! } ! catch (UserError e) {} ! symbols.removeAll(filterFieldAccesses()); Index: NiceFieldAccess.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceFieldAccess.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NiceFieldAccess.java 28 May 2003 12:57:26 -0000 1.14 --- NiceFieldAccess.java 26 Jul 2003 22:02:01 -0000 1.15 *************** *** 46,50 **** { List res = new LinkedList(); ! res.add(new FormalParameters.ThisParameter(Monotype.create(t))); return new FormalParameters(res); } --- 46,50 ---- { List res = new LinkedList(); ! res.add(new FormalParameters.Parameter(Monotype.create(t))); return new FormalParameters(res); } Index: NiceClass.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceClass.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** NiceClass.java 25 Jul 2003 16:13:10 -0000 1.50 --- NiceClass.java 26 Jul 2003 22:02:01 -0000 1.51 *************** *** 221,225 **** } }; ! scope.addSymbol(thisSymbol); --- 221,225 ---- } }; ! Node.thisExp = new SymbolExp(thisSymbol, definition.location()); scope.addSymbol(thisSymbol); *************** *** 227,230 **** --- 227,231 ---- initializers[i] = bossa.syntax.dispatch.analyse (initializers[i], definition.scope, localScope, false); + Node.thisExp = null; } Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** MethodBodyDefinition.java 25 Jul 2003 16:13:10 -0000 1.135 --- MethodBodyDefinition.java 26 Jul 2003 22:02:01 -0000 1.136 *************** *** 369,374 **** void resolveBody() { ! body = bossa.syntax.dispatch.analyse ! (body, scope, typeScope, !Types.isVoid(declaration.getReturnType())); } --- 369,382 ---- void resolveBody() { ! if (insideClass) ! Node.thisExp = new SymbolExp(parameters[0], location()); ! ! try { ! body = bossa.syntax.dispatch.analyse ! (body, scope, typeScope, !Types.isVoid(declaration.getReturnType())); ! } ! finally { ! Node.thisExp = null; ! } } Index: FormalParameters.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FormalParameters.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** FormalParameters.java 26 Jul 2003 12:04:13 -0000 1.27 --- FormalParameters.java 26 Jul 2003 22:02:01 -0000 1.28 *************** *** 222,235 **** } - static class ThisParameter extends Parameter - { - ThisParameter(Monotype type) - { - super(type); - } - - Expression value() { return Node.thisExp; } - } - /**************************************************************** * Main class --- 222,225 ---- |
From: <ar...@us...> - 2003-07-26 16:18:10
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv25324/F:/nice/stdlib/nice/lang Modified Files: enum.nice Log Message: Removed equals method in enum because it's the same as the default implementation. Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/enum.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** enum.nice 21 Jul 2003 17:24:14 -0000 1.2 --- enum.nice 26 Jul 2003 16:18:07 -0000 1.3 *************** *** 20,23 **** hashCode() = ordinal; toString() = name; - equals(that@Enum) = this == that; } --- 20,22 ---- |
From: <bo...@us...> - 2003-07-26 15:39:15
|
Update of /cvsroot/nice/Nice/testsuite/compiler/functions In directory sc8-pr-cvs1:/tmp/cvs-serv20955/testsuite/compiler/functions Modified Files: anonymous.testsuite Log Message: Properly typecheck anonymous functions as default values of method parameters. Index: anonymous.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/functions/anonymous.testsuite,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** anonymous.testsuite 25 Jul 2003 13:45:13 -0000 1.7 --- anonymous.testsuite 26 Jul 2003 12:04:13 -0000 1.8 *************** *** 75,79 **** int->String f = int i => { if (false) throw new Error(); }; ! /// FAIL bug /// Toplevel <T> void foo(T->int f = T x => x) {} --- 75,79 ---- int->String f = int i => { if (false) throw new Error(); }; ! /// FAIL /// Toplevel <T> void foo(T->int f = T x => x) {} |
From: <bo...@us...> - 2003-07-26 15:39:15
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv20955/src/bossa/syntax Modified Files: FormalParameters.java Log Message: Properly typecheck anonymous functions as default values of method parameters. Index: FormalParameters.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FormalParameters.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** FormalParameters.java 18 Jul 2003 22:56:49 -0000 1.26 --- FormalParameters.java 26 Jul 2003 12:04:13 -0000 1.27 *************** *** 206,209 **** --- 206,210 ---- defaultValue = defaultValue.noOverloading(); //defaultValue = defaultValue.resolveOverloading(new mlsub.typing.Polytype(domain)); + bossa.syntax.dispatch.typecheck(defaultValue); try { |
From: <bo...@us...> - 2003-07-26 15:04:21
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1:/tmp/cvs-serv18863 Modified Files: Flow4j.test Log Message: Use generic name for the Flow4j sources Index: Flow4j.test =================================================================== RCS file: /cvsroot/nice/tester/Flow4j.test,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Flow4j.test 12 May 2003 17:00:25 -0000 1.3 --- Flow4j.test 25 Jul 2003 14:11:31 -0000 1.4 *************** *** 11,15 **** if [ ! -r flow4j ]; then ! if [ ! -r flow4j-src-0.5.tar.gz ]; then wget http://flow4j.sf.net/releases/${SOURCES} fi --- 11,15 ---- if [ ! -r flow4j ]; then ! if [ ! -r ${SOURCES} ]; then wget http://flow4j.sf.net/releases/${SOURCES} fi |
From: <bo...@us...> - 2003-07-26 12:27:05
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1:/tmp/cvs-serv17273 Modified Files: Project Added Files: cvs-master Log Message: Added automatic upload of development version upon success --- NEW FILE: cvs-master --- #! /bin/sh # Wrapper for cvs, that retries seevral times in case of failure # Usage: # cvs <module name> CVS_RSH=ssh cvs -d:ext:bonniot@$CVS_SOURCEFORGE:/cvsroot/nice export \ -rHEAD "$@" Index: Project =================================================================== RCS file: /cvsroot/nice/tester/Project,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Project 12 May 2003 17:00:25 -0000 1.6 --- Project 25 Jul 2003 14:01:49 -0000 1.7 *************** *** 5,11 **** if [ ! -r Nice ]; then ! ../cvs Nice || exit 3 wget -O Nice/external/nice-bootstrap.jar http://nice.sf.net/nice.jar || exit 3 fi cd Nice && make world --- 5,16 ---- if [ ! -r Nice ]; then ! ../cvs${NICE_MASTER:+-master} Nice || exit 3 wget -O Nice/external/nice-bootstrap.jar http://nice.sf.net/nice.jar || exit 3 fi cd Nice && make world + + # If we got here, the whole bootstrap process succeeded. + if [ NICE_MASTER ]; then + scp ./share/java/nice.jar bo...@sh...:/home/groups/n/ni/nice/htdocs + fi |
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14848/F:/nice/src/bossa/syntax Modified Files: CallExp.java EnumDefinition.java GlobalVarDeclaration.java MethodBodyDefinition.java MethodDeclaration.java NiceClass.java VarSymbol.java Log Message: Reduced some cast's and instaneof's. Index: CallExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CallExp.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** CallExp.java 24 Jul 2003 21:26:19 -0000 1.81 --- CallExp.java 25 Jul 2003 16:13:10 -0000 1.82 *************** *** 367,382 **** return arguments.getExp(0) + "." + function + arguments.toStringInfix(); ! if (function instanceof SymbolExp && ! ((SymbolExp)function).getSymbol() instanceof MethodDeclaration.Symbol) { ! MethodDeclaration md = ((MethodDeclaration.Symbol) ! ((SymbolExp)function).getSymbol()).getDefinition(); ! if (md instanceof RetypedJavaMethod) return function.toString() + arguments; ! if (md instanceof JavaFieldAccess) return declaringClass.getName() + "." + ! ((JavaFieldAccess)md).fieldName + arguments; } --- 367,380 ---- return arguments.getExp(0) + "." + function + arguments.toStringInfix(); ! if (function instanceof SymbolExp) { ! Definition def = ((SymbolExp)function).getSymbol().getDefinition(); ! if (def instanceof RetypedJavaMethod) return function.toString() + arguments; ! if (def instanceof JavaFieldAccess) return declaringClass.getName() + "." + ! ((JavaFieldAccess)def).fieldName + arguments; } Index: EnumDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/EnumDefinition.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EnumDefinition.java 6 Jul 2003 23:25:37 -0000 1.2 --- EnumDefinition.java 25 Jul 2003 16:13:10 -0000 1.3 *************** *** 93,97 **** } ! Definition getDefinition() { return EnumDefinition.this; --- 93,97 ---- } ! public Definition getDefinition() { return EnumDefinition.this; Index: GlobalVarDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/GlobalVarDeclaration.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GlobalVarDeclaration.java 19 Jul 2003 00:54:05 -0000 1.18 --- GlobalVarDeclaration.java 25 Jul 2003 16:13:10 -0000 1.19 *************** *** 80,84 **** } ! Definition getDefinition() { return GlobalVarDeclaration.this; --- 80,84 ---- } ! public Definition getDefinition() { return GlobalVarDeclaration.this; Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** MethodBodyDefinition.java 15 Jul 2003 11:12:03 -0000 1.134 --- MethodBodyDefinition.java 25 Jul 2003 16:13:10 -0000 1.135 *************** *** 177,181 **** for(Iterator i = symbols.iterator(); i.hasNext();){ VarSymbol s = (VarSymbol)i.next(); ! if(!(s instanceof MethodDeclaration.Symbol)) { i.remove(); --- 177,181 ---- for(Iterator i = symbols.iterator(); i.hasNext();){ VarSymbol s = (VarSymbol)i.next(); ! if(s.getMethodDeclaration() == null) { i.remove(); *************** *** 183,187 **** } ! MethodDeclaration m = ((MethodDeclaration.Symbol) s).getDefinition(); if (m.getArity() != formals.length --- 183,187 ---- } ! MethodDeclaration m = s.getMethodDeclaration(); if (m.getArity() != formals.length *************** *** 233,237 **** for (int m1 = 0; m1 < size; m1++) { ! Monotype[] dom1 = tempSymbols[m1].getDefinition().getType().domain(); for (int m2 = 0; m2 < size; m2++) if (m1 != m2) --- 233,237 ---- for (int m1 = 0; m1 < size; m1++) { ! Monotype[] dom1 = tempSymbols[m1].getMethodDeclaration().getType().domain(); for (int m2 = 0; m2 < size; m2++) if (m1 != m2) *************** *** 239,243 **** boolean remove = true; boolean additionalsEqual = true; ! Monotype[] dom2 = tempSymbols[m2].getDefinition().getType().domain(); for (int i = 0; i < len; i++) if (additionalTags[i] != null) --- 239,243 ---- boolean remove = true; boolean additionalsEqual = true; ! Monotype[] dom2 = tempSymbols[m2].getMethodDeclaration().getType().domain(); for (int i = 0; i < len; i++) if (additionalTags[i] != null) *************** *** 271,275 **** outer: for(Iterator it = symbols.iterator(); it.hasNext();) { ! MethodDeclaration m = ((MethodDeclaration.Symbol) it.next()).getDefinition(); if( m instanceof NiceMethod) { FormalParameters params = m.formalParameters(); --- 271,275 ---- outer: for(Iterator it = symbols.iterator(); it.hasNext();) { ! MethodDeclaration m = ((MethodDeclaration.Symbol) it.next()).getMethodDeclaration(); if( m instanceof NiceMethod) { FormalParameters params = m.formalParameters(); *************** *** 295,299 **** { MethodDeclaration m = ! ((MethodDeclaration.Symbol) i.next()).getDefinition(); methods += m + " defined " + m.location() + "\n"; } --- 295,299 ---- { MethodDeclaration m = ! ((MethodDeclaration.Symbol) i.next()).getMethodDeclaration(); methods += m + " defined " + m.location() + "\n"; } *************** *** 332,339 **** User.error(this, name+" is not declared"); ! if(!(s instanceof MethodDeclaration.Symbol)) User.error(this, name+" is not a method"); ! MethodDeclaration decl = ((MethodDeclaration.Symbol) s).getDefinition(); setDeclaration(decl); --- 332,339 ---- User.error(this, name+" is not declared"); ! if(s.getMethodDeclaration() == null) User.error(this, name+" is not a method"); ! MethodDeclaration decl = s.getMethodDeclaration(); setDeclaration(decl); Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** MethodDeclaration.java 17 Jun 2003 12:03:05 -0000 1.43 --- MethodDeclaration.java 25 Jul 2003 16:13:10 -0000 1.44 *************** *** 304,309 **** FieldAccess getFieldAccessMethod() { ! if(getDefinition() instanceof FieldAccess) ! return (FieldAccess) getDefinition(); return null; --- 304,309 ---- FieldAccess getFieldAccessMethod() { ! if(getMethodDeclaration() instanceof FieldAccess) ! return (FieldAccess) getMethodDeclaration(); return null; *************** *** 312,316 **** void checkSpecialRequirements(Expression[] arguments) { ! getDefinition().checkSpecialRequirements(arguments); } --- 312,316 ---- void checkSpecialRequirements(Expression[] arguments) { ! getMethodDeclaration().checkSpecialRequirements(arguments); } *************** *** 324,345 **** } ! public MethodDeclaration getDefinition() { return MethodDeclaration.this; } ! gnu.expr.Expression compile() { ! return getDefinition().getCode(); } gnu.expr.Expression compileInCallPosition() { ! return getDefinition().getCodeInCallPosition(); } String explainWhyMatchFails(Arguments arguments) { ! return MethodDeclaration.this.explainWhyMatchFails(arguments); } --- 324,350 ---- } ! public Definition getDefinition() { return MethodDeclaration.this; } ! ! public MethodDeclaration getMethodDeclaration() ! { ! return MethodDeclaration.this; ! } ! gnu.expr.Expression compile() { ! return getMethodDeclaration().getCode(); } gnu.expr.Expression compileInCallPosition() { ! return getMethodDeclaration().getCodeInCallPosition(); } String explainWhyMatchFails(Arguments arguments) { ! return getMethodDeclaration().explainWhyMatchFails(arguments); } *************** *** 351,355 **** public String toString() { ! return MethodDeclaration.this.toString(); } } --- 356,360 ---- public String toString() { ! return getMethodDeclaration().toString(); } } Index: NiceClass.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceClass.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** NiceClass.java 18 Jul 2003 22:56:49 -0000 1.49 --- NiceClass.java 25 Jul 2003 16:13:10 -0000 1.50 *************** *** 366,370 **** MethodDeclaration.Symbol m = (MethodDeclaration.Symbol) i.next(); res[n] = new FormalParameters.Parameter[nbFields + m.arity]; ! mlsub.typing.Monotype[] args = m.getDefinition().getArgTypes(); for (int j = 0; j < args.length; j++) res[n][j] = new FormalParameters.Parameter(Monotype.create(args[j])); --- 366,370 ---- MethodDeclaration.Symbol m = (MethodDeclaration.Symbol) i.next(); res[n] = new FormalParameters.Parameter[nbFields + m.arity]; ! mlsub.typing.Monotype[] args = m.getMethodDeclaration().getArgTypes(); for (int j = 0; j < args.length; j++) res[n][j] = new FormalParameters.Parameter(Monotype.create(args[j])); Index: VarSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarSymbol.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** VarSymbol.java 24 Jun 2003 15:28:19 -0000 1.30 --- VarSymbol.java 25 Jul 2003 16:13:10 -0000 1.31 *************** *** 25,29 **** */ ! abstract class VarSymbol extends Node implements Located { public VarSymbol(LocatedString name) --- 25,29 ---- */ ! public abstract class VarSymbol extends Node implements Located { public VarSymbol(LocatedString name) *************** *** 54,60 **** --- 54,70 ---- } + public MethodDeclaration getMethodDeclaration() + { + return null; + } + void checkSpecialRequirements(Expression[] arguments) { // Do nothing by default. + } + + public Definition getDefinition() + { + return null; } |
From: <bo...@us...> - 2003-07-26 11:32:19
|
Update of /cvsroot/nice/Nice/src/gnu/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv7527/src/gnu/mapping Modified Files: ProcedureN.java Log Message: Remove spurious runtime dependency towards the Values class. Index: ProcedureN.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/mapping/ProcedureN.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ProcedureN.java 21 Jul 2003 19:08:50 -0000 1.4 --- ProcedureN.java 25 Jul 2003 13:03:24 -0000 1.5 *************** *** 18,24 **** } public Object apply0 () throws Throwable { ! return applyN(Values.noArgs); } --- 18,26 ---- } + private static final Object[] noArgs = new Object[0]; + public Object apply0 () throws Throwable { ! return applyN(noArgs); } |
From: <ar...@us...> - 2003-07-26 09:58:40
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1:/tmp/cvs-serv14848/F:/nice/src/bossa/link Modified Files: ImportedAlternative.java Log Message: Reduced some cast's and instaneof's. Index: ImportedAlternative.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/ImportedAlternative.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImportedAlternative.java 24 Jun 2003 15:28:19 -0000 1.5 --- ImportedAlternative.java 25 Jul 2003 16:13:10 -0000 1.6 *************** *** 17,20 **** --- 17,21 ---- import bossa.syntax.MethodDeclaration; import bossa.syntax.JavaMethod; + import bossa.syntax.VarSymbol; import nice.tools.code.*; *************** *** 98,105 **** for (Iterator i = methods.iterator(); i.hasNext();) { ! Object next = i.next(); ! if (! (next instanceof MethodDeclaration.Symbol)) continue; ! MethodDeclaration md = ((MethodDeclaration.Symbol) next).getDefinition(); if (md.getFullName().equals(fullName)) { --- 99,106 ---- for (Iterator i = methods.iterator(); i.hasNext();) { ! VarSymbol next = (VarSymbol)i.next(); ! if (next.getMethodDeclaration() == null) continue; ! MethodDeclaration md = next.getMethodDeclaration(); if (md.getFullName().equals(fullName)) { |
From: <bo...@us...> - 2003-07-26 08:32:51
|
Update of /cvsroot/nice/Nice/testsuite/compiler/functions In directory sc8-pr-cvs1:/tmp/cvs-serv14538/testsuite/compiler/functions Modified Files: anonymous.testsuite Log Message: Bug in the type-checking of anonymous functions as default values. Index: anonymous.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/functions/anonymous.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** anonymous.testsuite 22 May 2003 12:34:48 -0000 1.6 --- anonymous.testsuite 25 Jul 2003 13:45:13 -0000 1.7 *************** *** 74,75 **** --- 74,79 ---- /// FAIL int->String f = int i => { if (false) throw new Error(); }; + + /// FAIL bug + /// Toplevel + <T> void foo(T->int f = T x => x) {} |
From: <bo...@us...> - 2003-07-26 07:32:23
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1:/tmp/cvs-serv27945/src/mlsub/typing Modified Files: Polytype.java Log Message: When cloning the type of a method, also clone the type symbols in the arguments types (which can share type parameters, in case of default values that refer to quantified type variables, like anonymous functions). Index: Polytype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Polytype.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Polytype.java 24 Jul 2003 15:05:54 -0000 1.17 --- Polytype.java 25 Jul 2003 16:59:23 -0000 1.18 *************** *** 19,22 **** --- 19,23 ---- import mlsub.typing.lowlevel.Engine; import java.util.ArrayList; + import java.util.Map; /** *************** *** 48,56 **** public Polytype cloneType() { //Optimization if (isMonomorphic()) ! return this; ! java.util.Map map = new java.util.HashMap(); TypeSymbol[] binders = constraint.binders(); TypeSymbol[] newBinders = new TypeSymbol[binders.length]; --- 49,70 ---- public Polytype cloneType() { + Map map = getCloningMap(); + if (map == null) + return this; + else + return cloneType(map); + } + + public Map getCloningMap() + { //Optimization if (isMonomorphic()) ! return null; ! return new java.util.HashMap(); ! } ! ! public Polytype cloneType(Map map) ! { TypeSymbol[] binders = constraint.binders(); TypeSymbol[] newBinders = new TypeSymbol[binders.length]; *************** *** 67,71 **** monotype.substitute(map)); } ! public Constraint getConstraint() { --- 81,94 ---- monotype.substitute(map)); } ! ! public Polytype applyMap(Map map) ! { ! return new Polytype ! (isMonomorphic() ? Constraint.True ! : new Constraint(constraint.binders(), ! AtomicConstraint.substitute(map, constraint.atoms())), ! monotype.substitute(map)); ! } ! public Constraint getConstraint() { *************** *** 113,117 **** { // Optimization ! if (isMonomorphic()) return; --- 136,140 ---- { // Optimization ! if(!Constraint.hasBinders(constraint)) return; *************** *** 257,261 **** public void simplify() { ! if (isMonomorphic() || simplified || Polytype.noSimplify) return; --- 280,284 ---- public void simplify() { ! if (!Constraint.hasBinders(constraint) || simplified || Polytype.noSimplify) return; |
From: <bo...@us...> - 2003-07-26 07:23:18
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv28223/src/bossa/parser Modified Files: Parser.jj Log Message: Finished removing the 'fun' keyword. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** Parser.jj 22 Jul 2003 16:03:04 -0000 1.199 --- Parser.jj 25 Jul 2003 17:00:21 -0000 1.200 *************** *** 171,175 **** | < TRUE: "true" > | < FALSE: "false" > - | < FUN: "fun" > /* Nice specific */ | < ALIKE: "alike" > /* Nice specific */ //| < THIS: "this" > --- 171,174 ---- *************** *** 400,404 **** ( t = <IDENT> | t = "Any" - | t = "fun" | t = "alike" | t = "var" --- 399,402 ---- |
From: <bo...@us...> - 2003-07-26 06:53:11
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv29460/src/bossa/syntax Modified Files: SymbolExp.java Log Message: Optimization: since Polytype.cloneType is itself optimized, not doing the instanceof is faster. Index: SymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/SymbolExp.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** SymbolExp.java 17 Jun 2003 12:03:05 -0000 1.33 --- SymbolExp.java 25 Jul 2003 17:05:37 -0000 1.34 *************** *** 56,64 **** // So they hold different (but equivalent) types. ! // it's not necessary if the symbol is monomorphic ! if (symbol instanceof PolySymbol) ! type = symbol.getType().cloneType(); ! else ! type = symbol.getType(); } --- 56,60 ---- // So they hold different (but equivalent) types. ! type = symbol.getType().cloneType(); } |
From: <bo...@us...> - 2003-07-26 06:51:03
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv27945/testsuite/compiler/classes Modified Files: typeParameters.testsuite Log Message: When cloning the type of a method, also clone the type symbols in the arguments types (which can share type parameters, in case of default values that refer to quantified type variables, like anonymous functions). Index: typeParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/typeParameters.testsuite,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** typeParameters.testsuite 23 Jul 2003 16:17:53 -0000 1.11 --- typeParameters.testsuite 25 Jul 2003 16:59:23 -0000 1.12 *************** *** 216,220 **** ! /// PASS bug /// Toplevel class Impl<T> { --- 216,220 ---- ! /// PASS /// Toplevel class Impl<T> { |
From: <bo...@us...> - 2003-07-26 05:14:56
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv27945/src/bossa/syntax Modified Files: VarSymbol.java PolySymbol.java OverloadedSymbolExp.java MonoSymbol.java Log Message: When cloning the type of a method, also clone the type symbols in the arguments types (which can share type parameters, in case of default values that refer to quantified type variables, like anonymous functions). Index: VarSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarSymbol.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** VarSymbol.java 25 Jul 2003 16:13:10 -0000 1.31 --- VarSymbol.java 25 Jul 2003 16:59:24 -0000 1.32 *************** *** 118,122 **** // explained in OverloadedSymbolExp ! abstract void makeClonedType(); abstract void releaseClonedType(); abstract Polytype getClonedType(); --- 118,126 ---- // explained in OverloadedSymbolExp ! /** @param argTypes some types can contain unquantified occurences ! of the type parameters of this symbol, in which case they must be ! cloned too to keep the relationship. ! */ ! abstract void makeClonedType(Polytype[] argTypes); abstract void releaseClonedType(); abstract Polytype getClonedType(); Index: PolySymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/PolySymbol.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PolySymbol.java 13 Sep 2001 10:24:58 -0000 1.13 --- PolySymbol.java 25 Jul 2003 16:59:24 -0000 1.14 *************** *** 69,78 **** private Polytype clonedType; ! final void makeClonedType() { if(clonedType != null) Internal.error(this, "clonedType in use"); ! clonedType = type.cloneType(); } --- 69,88 ---- private Polytype clonedType; ! final void makeClonedType(Polytype[] argTypes) { if(clonedType != null) Internal.error(this, "clonedType in use"); ! java.util.Map map = type.getCloningMap(); ! if (map == null) ! { ! clonedType = type; ! return; ! } ! ! clonedType = type.cloneType(map); ! if (argTypes != null) ! for (int i = 0; i < argTypes.length; i++) ! argTypes[i] = argTypes[i].applyMap(map); } Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** OverloadedSymbolExp.java 19 Jun 2003 15:32:00 -0000 1.55 --- OverloadedSymbolExp.java 25 Jul 2003 16:59:24 -0000 1.56 *************** *** 135,138 **** --- 135,141 ---- Debug.println("Overloading: Trying with "+s); + Polytype[] argsType = + Expression.getType(arguments.getExpressions(s)); + // we clone the type to avoid clashes with another use // of the same symbol *************** *** 140,146 **** // and we check that cloneType() is not called twice // before the clone type is released ! s.makeClonedType(); ! Polytype[] argsType = ! Expression.getType(arguments.getExpressions(s)); Polytype t = CallExp.wellTyped(s.getClonedType(), argsType); --- 143,147 ---- // and we check that cloneType() is not called twice // before the clone type is released ! s.makeClonedType(argsType); Polytype t = CallExp.wellTyped(s.getClonedType(), argsType); *************** *** 201,205 **** { VarSymbol s = (VarSymbol) i.next(); ! s.makeClonedType(); try{ Typing.leq(s.getClonedType(), expectedType); --- 202,206 ---- { VarSymbol s = (VarSymbol) i.next(); ! s.makeClonedType(null); try{ Typing.leq(s.getClonedType(), expectedType); Index: MonoSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MonoSymbol.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MonoSymbol.java 13 Mar 2003 23:19:42 -0000 1.20 --- MonoSymbol.java 25 Jul 2003 16:59:24 -0000 1.21 *************** *** 141,145 **** // explained in OverloadedSymbolExp ! final void makeClonedType() {} final void releaseClonedType() {} --- 141,145 ---- // explained in OverloadedSymbolExp ! final void makeClonedType(Polytype[] argTypes) {} final void releaseClonedType() {} |
From: <bo...@us...> - 2003-07-26 04:39:09
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv27945/testsuite/compiler/typing Added Files: optionalParameters.testsuite Log Message: When cloning the type of a method, also clone the type symbols in the arguments types (which can share type parameters, in case of default values that refer to quantified type variables, like anonymous functions). --- NEW FILE: optionalParameters.testsuite --- /// PASS /// Toplevel <T> T->T foo(T->T f = T x => x) = f; <X> void bar() { int->int f = foo(); } |