nice-commit Mailing List for The Nice Programming Language (Page 108)
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: <bo...@us...> - 2003-05-26 20:52:30
|
Update of /cvsroot/nice/Nice/regtest/basic In directory sc8-pr-cvs1:/tmp/cvs-serv13836/regtest/basic Modified Files: optionalParameters.nice ok.out Log Message: Typecheck method default values with the method type parameters being rigid (closes #741560). Index: optionalParameters.nice =================================================================== RCS file: /cvsroot/nice/Nice/regtest/basic/optionalParameters.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** optionalParameters.nice 29 Apr 2002 14:38:20 -0000 1.7 --- optionalParameters.nice 26 May 2003 20:52:27 -0000 1.8 *************** *** 21,26 **** void oPFunction(int, int b, int c = 3, int d, int e, boolean skip = false) {} ! <Any T> void printAny(T what = "Nothing"); ! printAny(what) = println(what); void test_optional(); --- 21,30 ---- void oPFunction(int, int b, int c = 3, int d, int e, boolean skip = false) {} ! /* This is disabled at the moment. ! See comment at bossa.syntax.MethodDeclaration method typedResolve, ! line 148 as of CVS version 1.41. ! */ ! //<Any T> void printAny(T what = "Nothing"); ! //printAny(what) = println(what); void test_optional(); *************** *** 35,39 **** oP(1, b:3, d:3, e:4, skip:true); ! printAny(3); ! printAny(); } --- 39,43 ---- oP(1, b:3, d:3, e:4, skip:true); ! //printAny(3); ! //printAny(); } Index: ok.out =================================================================== RCS file: /cvsroot/nice/Nice/regtest/basic/ok.out,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ok.out 21 Oct 2002 17:09:23 -0000 1.32 --- ok.out 26 May 2003 20:52:27 -0000 1.33 *************** *** 46,51 **** a=3 b=2 c=4 d=1 e=5 a=1 b=3 c=3 d=3 e=4 - 3 - Nothing ### Testing classes (x=0, y=0) --- 46,49 ---- |
From: <bo...@us...> - 2003-05-26 20:52:30
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv13836/src/bossa/syntax Modified Files: MethodDeclaration.java Log Message: Typecheck method default values with the method type parameters being rigid (closes #741560). Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** MethodDeclaration.java 12 May 2003 11:11:44 -0000 1.40 --- MethodDeclaration.java 26 May 2003 20:52:27 -0000 1.41 *************** *** 144,147 **** --- 144,161 ---- try{ type.getConstraint().enter(); + + /* + We typecheck with rigid type parameters. It means that + default values must be valid for any instance of the method type. + + Alternatively, it could be decided that it is ok to have default + values that satisfy only specific instances. In that case, it would + be necessary to do some changes in K0. The difficulty is with + overloading: the (now soft) type variables could be modified + in an unsuccesful overloading resolution, and that modifications + need to be discarded. + */ + mlsub.typing.Typing.implies(); + parameters.typecheck(type.domain()); } |
From: <bo...@us...> - 2003-05-26 20:52:29
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv13836/testsuite/compiler/methods Modified Files: optionalParameters.testsuite Log Message: Typecheck method default values with the method type parameters being rigid (closes #741560). Index: optionalParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/optionalParameters.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** optionalParameters.testsuite 19 May 2003 18:49:55 -0000 1.6 --- optionalParameters.testsuite 26 May 2003 20:52:26 -0000 1.7 *************** *** 141,142 **** --- 141,163 ---- int getValue(int v = this.x) = v; } + + /// PASS + /// Toplevel + // Overloading in default values. + class B { + List<String> args; + String str; + } + + class A { + String str; + AA args; + alike f(int i = this.args.i, + String s = this.str, + String a = this.args.str) = this; + } + + class AA { + String str; + int i; + } |
From: <ar...@us...> - 2003-05-25 11:13:26
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv5622/F:/nice/testsuite/compiler/methods Modified Files: nullness.testsuite Log Message: Improvement of a testcase. Index: nullness.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/nullness.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** nullness.testsuite 24 May 2003 19:55:58 -0000 1.1 --- nullness.testsuite 25 May 2003 11:13:22 -0000 1.2 *************** *** 5,18 **** /// PASS ! foo(null); /// Toplevel ! void foo(?String); ! foo(#String){} ! foo(null){} /// PASS ! foo(null); /// Toplevel ! void foo(?String); ! foo(null){} ! foo(#String){} --- 5,20 ---- /// PASS ! assert !foo(null); ! assert foo("abc"); /// Toplevel ! boolean foo(?String); ! foo(#String) = true; ! foo(null) = false; /// PASS ! assert !foo(null); ! assert foo("abc"); /// Toplevel ! boolean foo(?String); ! foo(null) = false; ! foo(#String) = true; |
From: <ar...@us...> - 2003-05-24 20:10:12
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1:/tmp/cvs-serv17400/F:/nice/src/nice/tools/code Modified Files: IsOfClassProc.java Log Message: Fix the code generation of #type patterns so that no nullpointerexception can occur. Index: IsOfClassProc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/IsOfClassProc.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IsOfClassProc.java 18 Jun 2001 15:26:41 -0000 1.1 --- IsOfClassProc.java 24 May 2003 19:55:58 -0000 1.2 *************** *** 31,39 **** --- 31,46 ---- CodeAttr code = comp.getCode(); + //first a check is needed for the case that the argument is null args[0].compile(comp, Target.pushObject); + code.emitDup(); + code.emitIfNotNull(); code.emitInvokeVirtual(getClassMethod); code.emitInvokeVirtual(getNameMethod); code.emitPushString(type.getName()); code.emitInvokeVirtual(equalsMethod); + code.emitElse(); + code.emitPop(1); + code.emitPushBoolean(false); + code.emitFi(); target.compileFromStack(comp, Type.boolean_type); } |
From: <ar...@us...> - 2003-05-24 20:09:51
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv17400/F:/nice/testsuite/compiler/methods Modified Files: implementations.testsuite Added Files: nullness.testsuite Log Message: Fix the code generation of #type patterns so that no nullpointerexception can occur. --- NEW FILE: nullness.testsuite --- /// FAIL /// Toplevel void m(?String); m(@String) {} /// PASS foo(null); /// Toplevel void foo(?String); foo(#String){} foo(null){} /// PASS foo(null); /// Toplevel void foo(?String); foo(null){} foo(#String){} Index: implementations.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/implementations.testsuite,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** implementations.testsuite 24 May 2003 14:16:54 -0000 1.10 --- implementations.testsuite 24 May 2003 19:55:58 -0000 1.11 *************** *** 105,111 **** /// Toplevel void f(List<Array<String>>); - - /// FAIL - /// Toplevel - void m(?String); - m(@String) {} --- 105,106 ---- |
From: <ar...@us...> - 2003-05-24 14:16:57
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv5875/F:/nice/testsuite/compiler/methods Modified Files: implementations.testsuite Log Message: Fix the replacement of @type with @any patterns, it should only happen in case of a notnull domain. Index: implementations.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/implementations.testsuite,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** implementations.testsuite 23 May 2003 13:05:30 -0000 1.9 --- implementations.testsuite 24 May 2003 14:16:54 -0000 1.10 *************** *** 105,106 **** --- 105,111 ---- /// Toplevel void f(List<Array<String>>); + + /// FAIL + /// Toplevel + void m(?String); + m(@String) {} |
From: <ar...@us...> - 2003-05-24 14:16:57
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv5875/F:/nice/src/bossa/syntax Modified Files: MethodBodyDefinition.java Log Message: Fix the replacement of @type with @any patterns, it should only happen in case of a notnull domain. Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** MethodBodyDefinition.java 30 Apr 2003 11:30:52 -0000 1.121 --- MethodBodyDefinition.java 24 May 2003 14:16:53 -0000 1.122 *************** *** 400,404 **** TypeConstructor tc = Types.rawType(domain[n]).head(); if (tc != null && formals[n].tc != null) ! formals[n].setDomainEq(Typing.testRigidLeq(tc, formals[n].tc)); } --- 400,404 ---- TypeConstructor tc = Types.rawType(domain[n]).head(); if (tc != null && formals[n].tc != null) ! formals[n].setDomainEq(Types.isSure(domain[n]) && Typing.testRigidLeq(tc, formals[n].tc)); } |
From: <ar...@us...> - 2003-05-24 14:16:57
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1:/tmp/cvs-serv5875/F:/nice/src/nice/tools/code Modified Files: Types.java Log Message: Fix the replacement of @type with @any patterns, it should only happen in case of a notnull domain. Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Types.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Types.java 17 Mar 2003 20:11:41 -0000 1.48 --- Types.java 24 May 2003 14:16:53 -0000 1.49 *************** *** 608,616 **** ****************************************************************/ ! static boolean isMaybe(Monotype m) { // This is prob. laxist, since getTC() might be different but equivalent to maybeTC (?) return (m instanceof MonotypeConstructor) && ((MonotypeConstructor) m).getTC() == PrimitiveType.maybeTC; } --- 608,623 ---- ****************************************************************/ ! public static boolean isMaybe(Monotype m) { // This is prob. laxist, since getTC() might be different but equivalent to maybeTC (?) return (m instanceof MonotypeConstructor) && ((MonotypeConstructor) m).getTC() == PrimitiveType.maybeTC; + } + + public static boolean isSure(Monotype m) + { + // see comment by isMaybe (e?) + return (m instanceof MonotypeConstructor) + && ((MonotypeConstructor) m).getTC() == PrimitiveType.sureTC; } |
From: <ar...@us...> - 2003-05-23 13:05:34
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv7585/F:/nice/testsuite/compiler/methods Modified Files: implementations.testsuite Log Message: Fix of bug #738542(infinite recursion in enumerating the domains) Index: implementations.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/implementations.testsuite,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** implementations.testsuite 14 Mar 2003 00:55:24 -0000 1.8 --- implementations.testsuite 23 May 2003 13:05:30 -0000 1.9 *************** *** 82,83 **** --- 82,106 ---- void foo(B); foo(@A){} + + /// PASS + /// Toplevel + abstract class A<T> {} + class B<T> extends A<T> { + A<T> cons; + } + class C<T> extends A<T> { + A<T> cons; + } + <Any T> A<T> j(A<A<T>>); + j(b@B) = new B(cons: j(b.cons)); + j(c@C) = new C(cons: j(c.cons)); + + /// FAIL + /// Toplevel + class A<T> {} + class B<T> extends A<T> {} + <T> void j(A<A<T>>); + + /// FAIL + /// Toplevel + void f(List<Array<String>>); |
From: <ar...@us...> - 2003-05-23 13:05:34
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1:/tmp/cvs-serv7585/F:/nice/src/mlsub/typing/lowlevel Modified Files: Domain.java DomainVector.java Log Message: Fix of bug #738542(infinite recursion in enumerating the domains) Index: Domain.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Domain.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Domain.java 14 Jun 2000 13:32:44 -0000 1.1 --- Domain.java 23 May 2003 13:05:29 -0000 1.2 *************** *** 33,37 **** // size of this domain (possibly including unit) ! private int cardinal() { if (containsUnit) { return super.bitCount() + 1; --- 33,37 ---- // size of this domain (possibly including unit) ! int cardinal() { if (containsUnit) { return super.bitCount() + 1; *************** *** 202,206 **** * Iteration thru the domain elements **/ ! int getFirstBit() { int result = super.getLowestSetBit(); if (result == UNDEFINED_INDEX && containsUnit) { --- 202,206 ---- * Iteration thru the domain elements **/ ! int getFirstBit() { // unused method ??? int result = super.getLowestSetBit(); if (result == UNDEFINED_INDEX && containsUnit) { Index: DomainVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/DomainVector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DomainVector.java 22 Aug 2002 16:58:17 -0000 1.2 --- DomainVector.java 23 May 2003 13:05:30 -0000 1.3 *************** *** 182,187 **** /** * Choose a non-null, non-singleton, domain and return its index. Return -1 ! * if all the domains are instantiated. Assume the field cardUp or cardDown ! * are correct in the domains. **/ public int chooseDomain() { --- 182,186 ---- /** * Choose a non-null, non-singleton, domain and return its index. Return -1 ! * if all the domains are instantiated. **/ public int chooseDomain() { *************** *** 201,207 **** if (set == null || set.get(i + offset)) { Domain d = (Domain)elementAt(i); ! if (d != null && d.cardUp < leastCard && d.cardUp > 1) { ! least = i + offset; ! leastCard = d.cardUp; } } --- 200,209 ---- if (set == null || set.get(i + offset)) { Domain d = (Domain)elementAt(i); ! if (d != null){ ! int card = d.cardinal(); ! if (card < leastCard && card > 1) { ! least = i + offset; ! leastCard = card; ! } } } |
From: <bo...@us...> - 2003-05-22 22:10:33
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv24263/testsuite/compiler/classes Modified Files: implements.testsuite Log Message: Modified tests that should fail in the future because of unimplemented method (compareTo). They already fail on the kaffe jvm. Index: implements.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/implements.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** implements.testsuite 2 Sep 2002 16:49:31 -0000 1.3 --- implements.testsuite 22 May 2003 22:10:30 -0000 1.4 *************** *** 37,49 **** use(new A()); /// Toplevel ! class A implements java.lang.Comparable {} ! void use(java.lang.Comparable c) {} /// PASS use(new A()); /// Toplevel ! interface I extends java.lang.Comparable {} class A implements I {} ! void use(java.lang.Comparable c) {} --- 37,49 ---- use(new A()); /// Toplevel ! class A implements java.lang.Cloneable {} ! void use(java.lang.Cloneable c) {} /// PASS use(new A()); /// Toplevel ! interface I extends java.lang.Cloneable {} class A implements I {} ! void use(java.lang.Cloneable c) {} |
From: <bo...@us...> - 2003-05-22 12:39:47
|
Update of /cvsroot/nice/Nice/testsuite/compiler/functions In directory sc8-pr-cvs1:/tmp/cvs-serv29410/testsuite/compiler/functions Modified Files: local.testsuite anonymous.testsuite Log Message: An anonymous or local function that nevers returns normally can be considered to return any type. Index: local.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/functions/local.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** local.testsuite 8 May 2003 23:25:15 -0000 1.2 --- local.testsuite 22 May 2003 12:34:48 -0000 1.3 *************** *** 12,13 **** --- 12,22 ---- f2(4); assert x==5; + + /// COMMENT A local function returns any type iff it never returns + /// COMMENT normally (e.g. always throws an exception). + + /// PASS + String f(int i) { throw new Error(); } + + /// FAIL + String f(int i) { if (false) throw new Error(); } Index: anonymous.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/functions/anonymous.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** anonymous.testsuite 26 Feb 2003 17:09:23 -0000 1.5 --- anonymous.testsuite 22 May 2003 12:34:48 -0000 1.6 *************** *** 65,66 **** --- 65,75 ---- /* /// FAIL HERE */ return ""; }; + + /// COMMENT An anonymous function returns any type iff it never returns + /// COMMENT normally (e.g. always throws an exception). + + /// PASS + int->String f = int i => throw new Error(); + + /// FAIL + int->String f = int i => { if (false) throw new Error(); }; |
From: <bo...@us...> - 2003-05-22 12:39:43
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv29410/src/bossa/syntax Modified Files: FunExp.java Log Message: An anonymous or local function that nevers returns normally can be considered to return any type. Index: FunExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FunExp.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** FunExp.java 9 May 2003 08:59:11 -0000 1.40 --- FunExp.java 22 May 2003 12:34:48 -0000 1.41 *************** *** 83,87 **** if (inferredReturnType == null) // There is not return statement in the function. ! inferredReturnType = PrimitiveType.voidPolytype; else if (! alwaysReturns && --- 83,96 ---- if (inferredReturnType == null) // There is not return statement in the function. ! { ! if (alwaysReturns) ! /* This function never returns normally since there was no ! inferredReturnType, so it always throws an exception. ! Therefore, it can be considered to return any type. ! */ ! inferredReturnType = Polytype.bottom(); ! else ! inferredReturnType = PrimitiveType.voidPolytype; ! } else if (! alwaysReturns && |
From: <bo...@us...> - 2003-05-22 12:36:38
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv30046/debian Modified Files: changelog Log Message: Added operators to compute with java.math.BigInteger (+,-,*,/,%,...). Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** changelog 14 May 2003 14:39:12 -0000 1.162 --- changelog 22 May 2003 12:36:33 -0000 1.163 *************** *** 2,5 **** --- 2,6 ---- * Stable version, based on 0.7.9 + * Added operators to compute with java.math.BigInteger (+,-,*,/,%,...). * Bugfixes (some cases of optional parameters, allowing arbitrarily nested tuples on the left side of an assignment, recursion for local functions, |
From: <ar...@us...> - 2003-05-21 15:55:37
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv27785/F:/nice/testsuite/compiler/typing Modified Files: void.testsuite Log Message: Don't typecheck the return type of a short syntax void function. Index: void.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/void.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** void.testsuite 29 Apr 2003 11:17:06 -0000 1.2 --- void.testsuite 21 May 2003 15:55:33 -0000 1.3 *************** *** 49,50 **** --- 49,59 ---- void f() = doSomethingAndReturnAStatusBoolean(); + + /// PASS + /// Toplevel + void f() = null; + + /// PASS + /// Toplevel + void foo() = bar(); + ?String bar() = "abc"; |
From: <ar...@us...> - 2003-05-21 15:55:37
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv27785/F:/nice/src/bossa/syntax Modified Files: typecheck.nice Log Message: Don't typecheck the return type of a short syntax void function. Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** typecheck.nice 16 May 2003 12:05:15 -0000 1.68 --- typecheck.nice 21 May 2003 15:55:33 -0000 1.69 *************** *** 675,681 **** throw bossa.util.User.error(r, "This return is not inside a function"); if (r.value != null) { - ?mlsub.typing.Monotype expectedType = function.getExpectedType(); if (expectedType == null) r.value = notNull(r.value).noOverloading(); --- 675,681 ---- throw bossa.util.User.error(r, "This return is not inside a function"); + ?mlsub.typing.Monotype expectedType = function.getExpectedType(); if (r.value != null) { if (expectedType == null) r.value = notNull(r.value).noOverloading(); *************** *** 694,698 **** try{ ! function.checkReturnedType(r.returnType()); } catch(Function.WrongReturnType e){ --- 694,699 ---- try{ ! if ( !(r.fake && expectedType != null && nice.tools.code.Types.isVoid(expectedType))) ! function.checkReturnedType(r.returnType()); } catch(Function.WrongReturnType e){ |
From: <bo...@us...> - 2003-05-21 15:42:37
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv7638/testsuite/compiler/syntax Modified Files: loops.testsuite Log Message: Check that the collection of locals is correctly computed after exiting an inner loop. Index: loops.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/loops.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** loops.testsuite 21 May 2003 14:21:00 -0000 1.2 --- loops.testsuite 21 May 2003 15:30:42 -0000 1.3 *************** *** 26,30 **** for (int i = 0; i < 5; i++) x = 7; ! } /// PASS --- 26,38 ---- for (int i = 0; i < 5; i++) x = 7; ! } ! ! /// PASS ! for (int k = 0; k < 3; k++) { ! let int x; ! for (int i = 0; i < 5; i++) ! ; ! x = 7; ! } /// PASS *************** *** 43,48 **** /// PASS - /// COMMENT: this was broken in all versions before 29-4-03 boolean update = false; for (int i = 0; i < 5; i++,update=true){} ! assert(update); \ No newline at end of file --- 51,55 ---- /// PASS boolean update = false; for (int i = 0; i < 5; i++,update=true){} ! assert(update); |
From: <bo...@us...> - 2003-05-21 15:40:11
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv8885/src/bossa/syntax Modified Files: analyse.nice Log Message: Use a LinkedList instead of a HashSet to store the collection of locals in the most inner loop. They form a set by construction, and the overhead of maintaining a hashtable is huge, given the typically small number of locals in a loop block. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** analyse.nice 21 May 2003 14:21:00 -0000 1.68 --- analyse.nice 21 May 2003 15:32:13 -0000 1.69 *************** *** 70,74 **** ?LoopStmt currentLoop = null; ! ?Set<VarSymbol> currentLoopVars = null; Stack<LabeledStmt> labels = new Stack(); --- 70,77 ---- ?LoopStmt currentLoop = null; ! /* The set of all local constant variables whose scope is the current ! most inner loop. Null if we are not inside a loop at this point. ! */ ! ?Collection<VarSymbol> localsOfCurrentLoop = null; Stack<LabeledStmt> labels = new Stack(); *************** *** 220,225 **** { if (v.constant && (info.flags[v.index] || ! info.currentLoopVars != null && ! !notNull(info.currentLoopVars).contains(v))) bossa.util.User.error(loc, "" + v + " cannot be assigned a value multiple times"); --- 223,228 ---- { if (v.constant && (info.flags[v.index] || ! info.localsOfCurrentLoop != null && ! !notNull(info.localsOfCurrentLoop).contains(v))) bossa.util.User.error(loc, "" + v + " cannot be assigned a value multiple times"); *************** *** 556,561 **** info.addVar(notNull(decl.left)); ! if (info.currentLoopVars != null && notNull(decl.left).constant) ! notNull(info.currentLoopVars).add(notNull(decl.left)); } --- 559,564 ---- info.addVar(notNull(decl.left)); ! if (info.localsOfCurrentLoop != null && notNull(decl.left).constant) ! notNull(info.localsOfCurrentLoop).add(notNull(decl.left)); } *************** *** 614,626 **** ?LoopStmt save = info.currentLoop; ! ?Set<VarSymbol> loopVarSave = info.currentLoopVars; info.currentLoop = l; ! info.currentLoopVars = new HashSet(); analyse(l.loopBody, info); info.currentLoop = save; ! info.currentLoopVars = loopVarSave; /* The update code is considered reachable even if the loop cannot terminate --- 617,629 ---- ?LoopStmt save = info.currentLoop; ! ?Collection<VarSymbol> localsOfCurrentLoopSave = info.localsOfCurrentLoop; info.currentLoop = l; ! info.localsOfCurrentLoop = new LinkedList(); analyse(l.loopBody, info); info.currentLoop = save; ! info.localsOfCurrentLoop = localsOfCurrentLoopSave; /* The update code is considered reachable even if the loop cannot terminate |
From: <ar...@us...> - 2003-05-21 14:21:04
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14900/F:/nice/testsuite/compiler/syntax Modified Files: loops.testsuite Log Message: Fix checking of assignments to uninitialized local constants inside loops. Index: loops.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/loops.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** loops.testsuite 29 Apr 2003 21:06:50 -0000 1.1 --- loops.testsuite 21 May 2003 14:21:00 -0000 1.2 *************** *** 10,17 **** for (i = 0; i < 10; i++){} ! /// FAIL bug ! let int x; ! for (int i = 0; i < 5; i++) x = 7; /// PASS --- 10,38 ---- for (i = 0; i < 10; i++){} ! /// FAIL ! let int x; ! for (int i = 0; i < 5; i++) ! x = 7; ! ! /// PASS ! for (int i = 0; i < 5; i++) { ! let int x; x = 7; + } + + /// FAIL + for (int k = 0; k < 3; k++) { + let int x; + for (int i = 0; i < 5; i++) + x = 7; + } + + /// PASS + for (int k = 0; k < 3; k++) { + for (int i = 0; i < 5; i++) { + let int x; + x = 7; + } + } /// PASS |
From: <ar...@us...> - 2003-05-21 14:21:03
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14900/F:/nice/src/bossa/syntax Modified Files: analyse.nice Log Message: Fix checking of assignments to uninitialized local constants inside loops. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** analyse.nice 9 May 2003 13:17:03 -0000 1.67 --- analyse.nice 21 May 2003 14:21:00 -0000 1.68 *************** *** 70,73 **** --- 70,75 ---- ?LoopStmt currentLoop = null; + ?Set<VarSymbol> currentLoopVars = null; + Stack<LabeledStmt> labels = new Stack(); *************** *** 217,223 **** if (v.index != -1) { ! if (v.constant && info.flags[v.index]) bossa.util.User.error(loc, ! "" + v + " cannot be assigned a value twice"); info.flags |= 1 << v.index; --- 219,227 ---- if (v.index != -1) { ! if (v.constant && (info.flags[v.index] || ! info.currentLoopVars != null && ! !notNull(info.currentLoopVars).contains(v))) bossa.util.User.error(loc, ! "" + v + " cannot be assigned a value multiple times"); info.flags |= 1 << v.index; *************** *** 551,554 **** --- 555,561 ---- decl.setIndex(++info.varIndex); info.addVar(notNull(decl.left)); + + if (info.currentLoopVars != null && notNull(decl.left).constant) + notNull(info.currentLoopVars).add(notNull(decl.left)); } *************** *** 607,615 **** --- 614,626 ---- ?LoopStmt save = info.currentLoop; + ?Set<VarSymbol> loopVarSave = info.currentLoopVars; + info.currentLoop = l; + info.currentLoopVars = new HashSet(); analyse(l.loopBody, info); info.currentLoop = save; + info.currentLoopVars = loopVarSave; /* The update code is considered reachable even if the loop cannot terminate |
From: <bo...@us...> - 2003-05-20 15:06:05
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv17481/stdlib/nice/lang Added Files: bigint.nice Log Message: Added operators for java.math.BigInteger. --- NEW FILE: bigint.nice --- package nice.lang; // Operators to manipulate java.math.BigInteger. import java.math.*; BigInteger `-`(BigInteger) = native BigInteger BigInteger.negate(); BigInteger `+`(BigInteger, BigInteger) = native BigInteger BigInteger.add(BigInteger); BigInteger `-`(BigInteger, BigInteger) = native BigInteger BigInteger.subtract(BigInteger); BigInteger `*`(BigInteger, BigInteger) = native BigInteger BigInteger.multiply(BigInteger); BigInteger `/`(BigInteger, BigInteger) = native BigInteger BigInteger.divide(BigInteger); BigInteger `%`(BigInteger, BigInteger) = native BigInteger BigInteger.remainder(BigInteger); BigInteger `<<`(BigInteger, int) = native BigInteger BigInteger.shiftLeft(int); BigInteger `>>`(BigInteger, int) = native BigInteger BigInteger.shiftRight(int); BigInteger `&`(BigInteger, BigInteger) = native BigInteger BigInteger.and(BigInteger); BigInteger `|`(BigInteger, BigInteger) = native BigInteger BigInteger.or(BigInteger); //BigInteger `^`(BigInteger, BigInteger) = native BigInteger BigInteger.xor(BigInteger); BigInteger `~`(BigInteger) = native BigInteger BigInteger.not(); /* Implement the Comparable interface. The four comparison operators (<, >, <=, and >=) can be used on BigIntegers. Only `<` is implemented here, because the others have generic implementations that use < and boolean negation. */ `<`(x@BigInteger, y@BigInteger) = x.compareTo(y) < 0; |
From: <bo...@us...> - 2003-05-20 15:06:05
|
Update of /cvsroot/nice/Nice/testsuite/lib/java/math In directory sc8-pr-cvs1:/tmp/cvs-serv17481/testsuite/lib/java/math Added Files: bigint.testsuite Log Message: Added operators for java.math.BigInteger. --- NEW FILE: bigint.testsuite --- /// PASS BigInteger maxlong = BigInteger.valueOf(Long.MAX_VALUE); BigInteger two = BigInteger.valueOf(2); BigInteger three = BigInteger.valueOf(3); BigInteger i = maxlong * three + maxlong; assert i > maxlong; assert ! (i <= maxlong); assert maxlong < i; assert ! (maxlong >= i); assert (i / two).equals(two * maxlong); /// Toplevel import java.math.*; |
From: <bo...@us...> - 2003-05-20 15:01:02
|
Update of /cvsroot/nice/Nice/testsuite/lib/java/math In directory sc8-pr-cvs1:/tmp/cvs-serv13623/testsuite/lib/java/math Log Message: Directory /cvsroot/nice/Nice/testsuite/lib/java/math added to the repository |
From: <bo...@us...> - 2003-05-20 14:48:14
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1:/tmp/cvs-serv5757/testsuite/compiler/native Modified Files: methods.testsuite Log Message: Do not rely on having only one method named toString in the global scope. Index: methods.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/methods.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** methods.testsuite 24 Jan 2003 19:08:37 -0000 1.1 --- methods.testsuite 20 May 2003 14:48:10 -0000 1.2 *************** *** 6,10 **** /// PASS ! // Static methods are not in the global score. byte->String f = Byte.toString; ! String[] s = [1].map(toString); --- 6,10 ---- /// PASS ! // Static methods are not in the global scope. byte->String f = Byte.toString; ! String[] s = [1].map(int i => toString(i)); |