nice-commit Mailing List for The Nice Programming Language (Page 4)
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: Daniel B. <bo...@us...> - 2005-06-22 14:34:21
|
Update of /cvsroot/nice/Nice/src/nice/tools/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9258/src/nice/tools/typing Modified Files: Types.java Log Message: Fix getTypeParameter on nullary type constructor. Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/typing/Types.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Types.java 25 May 2005 23:22:57 -0000 1.16 --- Types.java 22 Jun 2005 14:34:12 -0000 1.17 *************** *** 229,233 **** Monotype[] parameters = ((MonotypeConstructor) type).getTP(); ! if (parameters.length <= rank) return null; else --- 229,233 ---- Monotype[] parameters = ((MonotypeConstructor) type).getTP(); ! if (parameters == null || parameters.length <= rank) return null; else |
From: Daniel B. <bo...@us...> - 2005-06-22 14:34:21
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9258/testsuite/compiler/expressions/arrays Modified Files: literal.testsuite Log Message: Fix getTypeParameter on nullary type constructor. Index: literal.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/literal.testsuite,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** literal.testsuite 30 Jul 2004 18:31:11 -0000 1.13 --- literal.testsuite 22 Jun 2005 14:34:11 -0000 1.14 *************** *** 57,58 **** --- 57,65 ---- /// FAIL int[] i = [1, /*/// FAIL HERE*/ ""]; + + /// FAIL + let String /* /// FAIL HERE */ foo = []; + + /// FAIL + /// Toplevel + let String /* /// FAIL HERE */ foo = []; |
From: Daniel B. <bo...@us...> - 2005-06-21 18:31:28
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21791/src/mlsub/typing Modified Files: UnknownMonotype.java MonotypeVar.java Monotype.java Log Message: Handle setting the unknown flag on monotype variables that have been frozen. Index: MonotypeVar.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/MonotypeVar.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MonotypeVar.java 9 Jun 2005 14:11:37 -0000 1.22 --- MonotypeVar.java 21 Jun 2005 18:31:00 -0000 1.23 *************** *** 230,236 **** private boolean unknown; ! boolean isUnknown() { return unknown; } ! void setUnknown(boolean leq, boolean geq) throws mlsub.typing.lowlevel.Unsatisfiable { --- 230,236 ---- private boolean unknown; ! public boolean isUnknown() { return unknown; } ! public void setUnknown(boolean leq, boolean geq) throws mlsub.typing.lowlevel.Unsatisfiable { Index: Monotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Monotype.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Monotype.java 18 Jun 2005 09:58:39 -0000 1.13 --- Monotype.java 21 Jun 2005 18:31:00 -0000 1.14 *************** *** 121,127 **** } ! boolean isUnknown() { return false; } ! void setUnknown(boolean leq, boolean geq) throws mlsub.typing.lowlevel.Unsatisfiable { --- 121,127 ---- } ! public boolean isUnknown() { return false; } ! public void setUnknown(boolean leq, boolean geq) throws mlsub.typing.lowlevel.Unsatisfiable { Index: UnknownMonotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/UnknownMonotype.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UnknownMonotype.java 25 May 2005 11:52:30 -0000 1.3 --- UnknownMonotype.java 21 Jun 2005 18:30:59 -0000 1.4 *************** *** 30,34 **** public TypeSymbol cloneTypeSymbol() { return this; } ! boolean isUnknown() { return true; } Monotype canonify() { return this; } --- 30,34 ---- public TypeSymbol cloneTypeSymbol() { return this; } ! public boolean isUnknown() { return true; } Monotype canonify() { return this; } |
From: Daniel B. <bo...@us...> - 2005-06-21 18:31:08
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21791/src/mlsub/typing/lowlevel Modified Files: Engine.java Log Message: Handle setting the unknown flag on monotype variables that have been frozen. Index: Engine.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Engine.java 17 Jun 2005 14:14:08 -0000 1.38 --- Engine.java 21 Jun 2005 18:30:59 -0000 1.39 *************** *** 533,557 **** { s.push(leq.e2); } else { ! if(leq.e1.getKind()!=leq.e2.getKind()) ! throw new InternalError("Bad kinding in Engine.setKind 1"); ! i.remove(); ! k.leq(leq.e1,leq.e2,initialContext); ! } else if(leq.e2==e) // If e is Top, e1 <: e is trivial and can be discarded. if (toTop) ! i.remove(); else if (leq.e1.getKind() == null) ! s.push(leq.e1); else { ! if(leq.e1.getKind()!=leq.e2.getKind()) ! throw new InternalError("Bad kinding in Engine.setKind 2"); ! i.remove(); ! k.leq(leq.e1,leq.e2,initialContext); ! } } } --- 533,579 ---- { s.push(leq.e2); + continue; } else { ! // General case later ! } else if(leq.e2==e) // If e is Top, e1 <: e is trivial and can be discarded. if (toTop) ! { ! i.remove(); ! continue; ! } else if (leq.e1.getKind() == null) ! { ! s.push(leq.e1); ! continue; ! } else { ! // General case later ! } ! else ! continue; ! ! // General case, add leq.e1 <: leq.e2 ! if (leq.e1.getKind() != leq.e2.getKind()) ! throw new InternalError("Bad kinding in Engine.setKind"); ! ! if (leq.e1 instanceof mlsub.typing.Monotype && ! leq.e2 instanceof mlsub.typing.Monotype) ! { ! mlsub.typing.Monotype e1 = (mlsub.typing.Monotype) leq.e1; ! mlsub.typing.Monotype e2 = (mlsub.typing.Monotype) leq.e2; ! ! if (e1.isUnknown()) ! e2.setUnknown(false, true); ! else if (e2.isUnknown()) ! e1.setUnknown(true, false); ! } ! ! i.remove(); ! k.leq(leq.e1,leq.e2,initialContext); } } |
From: Daniel B. <bo...@us...> - 2005-06-21 18:31:08
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21791/testsuite/compiler/typing Modified Files: wildcards.testsuite Log Message: Handle setting the unknown flag on monotype variables that have been frozen. Index: wildcards.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/wildcards.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wildcards.testsuite 18 Jun 2005 09:58:39 -0000 1.6 --- wildcards.testsuite 21 Jun 2005 18:30:57 -0000 1.7 *************** *** 167,168 **** --- 167,192 ---- /// Toplevel <T0> T0 foo(T0 x) = x; + + + /// FAIL + A<?,?> ctx = new A(); + ctx./*/// FAIL HERE */ get0("bar"); + /// Toplevel + class A<K,V> { } + <K, K0, V | K <: K0> void get0(A<K, V>, K0) {} + + /// FAIL + A<?,?> ctx = new A(); + ctx./*/// FAIL HERE */ get0("bar"); + /// Toplevel + class A<K,V> { } + <K, K0, V0, V | K <: K0, V <: ?V0> ?V0 get0(A<K, V>, K0) = null; + + /// FAIL + A<String> a = new A(x: ""); + A<?> ctx = a; + ctx./*/// FAIL HERE */ set0(0); + String s = a.x; + /// Toplevel + class A<K> { K x; } + <K, K0 | K0 <: K> void set0(A<K> a, K0 v) = a.x = v; |
From: Daniel B. <bo...@us...> - 2005-06-21 16:40:01
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30121/testsuite/compiler/native Modified Files: import.testsuite Log Message: Testcases for static import. Index: import.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/import.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** import.testsuite 13 Mar 2005 15:27:42 -0000 1.4 --- import.testsuite 21 Jun 2005 16:39:36 -0000 1.5 *************** *** 22,23 **** --- 22,65 ---- import java.util.*; import java.sql.*; + + + /// COMMENT static import + + /// PASS + let PI2 = PI/2; + /// Toplevel + import static java.lang.Math.PI; + + /// FAIL + /// package a + /// Toplevel + import static java.lang.Math.PI; + /// package b import a + // Check that the static import is not leaked + let x = /*/// FAIL HERE */ PI; + + /// PASS + if (false) + gc(); + /// Toplevel + import static java.lang.System.gc; + + /// FAIL + /// Toplevel + import static /*/// FAIL HERE */ FooBar; + + /// FAIL + /// Toplevel + import static FooBar /*/// FAIL HERE */ .; + + /// FAIL + /// Toplevel + import static /*/// FAIL HERE */ FooBar.baz; + + /// FAIL + /// Toplevel + import static /*/// FAIL HERE */ int.baz; + + /// FAIL + /// Toplevel + import static /*/// FAIL HERE */ java.lang.String.baz; |
From: Daniel B. <bo...@us...> - 2005-06-18 13:27:10
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24032/src/bossa/syntax Modified Files: dispatch.java.bootstrap Module.java Log Message: Implemented static import. Index: dispatch.java.bootstrap =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatch.java.bootstrap,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** dispatch.java.bootstrap 11 Mar 2005 17:35:52 -0000 1.55 --- dispatch.java.bootstrap 18 Jun 2005 13:26:55 -0000 1.56 *************** *** 52,54 **** --- 52,56 ---- public static void _printStackTraceWithSourceInfo(Throwable t) {} + + public static java.util.List findJavaMethods(gnu.bytecode.ClassType c, String s) { return null; } } Index: Module.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Module.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Module.java 11 Mar 2005 17:35:52 -0000 1.26 --- Module.java 18 Jun 2005 13:26:55 -0000 1.27 *************** *** 36,38 **** --- 36,72 ---- public boolean compiled() { return pkg.interfaceFile(); } + + public void addStaticImport(LocatedString value) + { + String fullName = value.toString(); + + int lastDot = fullName.lastIndexOf('.'); + if (lastDot == -1) + bossa.util.User.error(value, "Missing field or method name"); + + String methodName = fullName.substring(lastDot+1); + fullName = fullName.substring(0, lastDot); + + mlsub.typing.TypeConstructor tc = + Node.getGlobalTypeScope().globalLookup(fullName, value.location()); + + if(tc == null) + bossa.util.User.error(value, "Unknown class: " + fullName); + + gnu.bytecode.Type type = nice.tools.code.Types.javaType(tc); + if (! (type instanceof gnu.bytecode.ClassType)) + bossa.util.User.error(value, fullName + " is not a class"); + + java.util.List symbols = dispatch.findJavaMethods + ((gnu.bytecode.ClassType) type, methodName); + + if (symbols.size() == 0) + bossa.util.User.error(value, methodName + " is not a static field or method of class " + fullName); + + for (java.util.Iterator i = symbols.iterator(); i.hasNext();) + { + /*Var*/Symbol s = (/*Var*/Symbol) i.next(); + scope.addSymbol(s); + } + } } |
From: Daniel B. <bo...@us...> - 2005-06-18 13:27:10
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24032/src/bossa/parser Modified Files: Parser.jj JavaccParser.java Log Message: Implemented static import. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.330 retrieving revision 1.331 diff -C2 -d -r1.330 -r1.331 *** Parser.jj 25 May 2005 11:52:30 -0000 1.330 --- Parser.jj 18 Jun 2005 13:26:55 -0000 1.331 *************** *** 1944,1953 **** [ "package" pkgName=doted_string() ";" ] ( ! "import" name=doted_string() ! ( ".*" { opens.add(name.toString()); } ! [ "(" "!" ")" ! { nice.tools.code.Import.addStrictPackage(name.toString()); } ! ] ! | { imports.add(name); } ) ";" --- 1944,1957 ---- [ "package" pkgName=doted_string() ";" ] ( ! "import" ! ( "static" doted_string() ! | ! name=doted_string() ! ( ".*" { opens.add(name.toString()); } ! [ "(" "!" ")" ! { nice.tools.code.Import.addStrictPackage(name.toString()); } ! ] ! | { imports.add(name); } ! ) ) ";" *************** *** 1956,1965 **** } ! void readOpens(): ! {} { [ "package" doted_string() ";" ] ( ! "import" doted_string() [ ".*" [ "(" "!" ")" ] ] ";" )* --- 1960,1975 ---- } ! void readOpens(Module module): ! { LocatedString s; } { [ "package" doted_string() ";" ] ( ! "import" ! ( ! "static" s=doted_string() ! { module.addStaticImport(s); } ! | ! doted_string() [ ".*" [ "(" "!" ")" ] ] ! ) ";" )* *************** *** 1970,1977 **** ****************************************************************/ ! void module(List definitions, boolean storeDocStrings): {} { ! readOpens() readDefinitions(definitions, storeDocStrings) } --- 1980,1987 ---- ****************************************************************/ ! void module(Module module, List definitions, boolean storeDocStrings): {} { ! readOpens(module) readDefinitions(definitions, storeDocStrings) } Index: JavaccParser.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/JavaccParser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JavaccParser.java 22 Mar 2005 10:55:06 -0000 1.5 --- JavaccParser.java 18 Jun 2005 13:26:55 -0000 1.6 *************** *** 60,64 **** } ! public void read(Reader r, List definitions) { chrono.start(); --- 60,64 ---- } ! public void read(Reader r, bossa.syntax.Module module, List definitions) { chrono.start(); *************** *** 68,72 **** try{ ! parser.module(definitions, storeDocStrings); } catch(ParseException e){ --- 68,72 ---- try{ ! parser.module(module, definitions, storeDocStrings); } catch(ParseException e){ |
From: Daniel B. <bo...@us...> - 2005-06-18 13:27:10
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24032/src/bossa/modules Modified Files: Parser.java Content.java Log Message: Implemented static import. Index: Parser.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Parser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Parser.java 3 Jan 2005 01:24:12 -0000 1.2 --- Parser.java 18 Jun 2005 13:26:55 -0000 1.3 *************** *** 27,31 **** LocatedString readImports(Reader r, List imports, Collection opens); ! void read(Reader r, List definitions); /*bossa.syntax.FormalParameters*/Object formalParameters(String parameters); --- 27,31 ---- LocatedString readImports(Reader r, List imports, Collection opens); ! void read(Reader r, bossa.syntax.Module module, List definitions); /*bossa.syntax.FormalParameters*/Object formalParameters(String parameters); Index: Content.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Content.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Content.java 12 Apr 2005 12:38:11 -0000 1.21 --- Content.java 18 Jun 2005 13:26:55 -0000 1.22 *************** *** 128,132 **** Definition.currentModule = module; ! pkg.compilation.parser.read(unit.reader, definitions); Definition.currentModule = null; --- 128,132 ---- Definition.currentModule = module; ! pkg.compilation.parser.read(unit.reader, module, definitions); Definition.currentModule = null; |
From: Daniel B. <bo...@us...> - 2005-06-18 13:27:09
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24032 Modified Files: NEWS Log Message: Implemented static import. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** NEWS 7 Jun 2005 08:34:02 -0000 1.80 --- NEWS 18 Jun 2005 13:26:56 -0000 1.81 *************** *** 1,2 **** --- 1,10 ---- + nice (0.9.12) + + * Support for static import: + + import static java.lang.Math.PI; + + -- + nice (0.9.11) |
From: Daniel B. <bo...@us...> - 2005-06-18 12:47:01
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3311/src/bossa/syntax Modified Files: javaMethod.nice javaFieldAccess.nice Log Message: Check when a field's name is used only when trying to import all fields from a class, not when explicitely importing a given field (saves time, and useful for static import). Index: javaMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaMethod.nice,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** javaMethod.nice 2 Apr 2005 09:09:08 -0000 1.15 --- javaMethod.nice 18 Jun 2005 12:46:47 -0000 1.16 *************** *** 234,237 **** --- 234,240 ---- continue; + if (! usedIdentifiers.contains(f.getName())) + continue; + if (retyped.get(f) == null) addJavaSymbol(f, makeJavaFieldAccess(f)); Index: javaFieldAccess.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaFieldAccess.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** javaFieldAccess.nice 1 Apr 2005 00:09:23 -0000 1.9 --- javaFieldAccess.nice 18 Jun 2005 12:46:47 -0000 1.10 *************** *** 145,151 **** ?MethodDeclaration makeJavaFieldAccess(gnu.bytecode.Field f) { - if (! usedIdentifiers.contains(f.getName())) - return null; - try { mlsub.typing.Monotype[?] params; --- 145,148 ---- |
From: Daniel B. <bo...@us...> - 2005-06-18 09:58:50
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29740/src/mlsub/typing Modified Files: NullnessKind.java Monotype.java Log Message: '?' is not a subtype of Object, only of ?Object. Index: NullnessKind.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/NullnessKind.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NullnessKind.java 9 Jun 2005 11:57:00 -0000 1.8 --- NullnessKind.java 18 Jun 2005 09:58:39 -0000 1.9 *************** *** 38,42 **** public int arity() { return 1; } ! private static TypeConstructor maybe, sure; public Monotype freshMonotype(boolean existential) --- 38,42 ---- public int arity() { return 1; } ! static TypeConstructor maybe, sure; public Monotype freshMonotype(boolean existential) Index: Monotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Monotype.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Monotype.java 9 Jun 2005 11:57:00 -0000 1.12 --- Monotype.java 18 Jun 2005 09:58:39 -0000 1.13 *************** *** 131,134 **** --- 131,141 ---- if (geq) { + // We must check that this monotype is not non-null + TypeConstructor head = head(); + if (head == null) + throw mlsub.typing.lowlevel.LowlevelUnsatisfiable.instance; + else + mlsub.typing.lowlevel.Engine.leq(NullnessKind.maybe, head); + Monotype raw = nice.tools.typing.Types.rawType(this); mlsub.typing.lowlevel.Engine.leq(TopMonotype.instance, raw); |
From: Daniel B. <bo...@us...> - 2005-06-18 09:58:47
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29740/testsuite/compiler/typing Modified Files: wildcards.testsuite Log Message: '?' is not a subtype of Object, only of ?Object. Index: wildcards.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/wildcards.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wildcards.testsuite 9 Jun 2005 14:11:36 -0000 1.5 --- wildcards.testsuite 18 Jun 2005 09:58:39 -0000 1.6 *************** *** 40,44 **** /// Toplevel class A<T0> { T0 x; } ! Object foo(A<?> a) = a.x; /// FAIL --- 40,44 ---- /// Toplevel class A<T0> { T0 x; } ! ?Object foo(A<?> a) = a.x; /// FAIL *************** *** 144,149 **** A<?> a = new A(x: 0); let x = a.x; ! Object o = foo(x); /// Toplevel class A<T> { T x; } <T0> T0 foo(T0 x) = x; --- 144,168 ---- A<?> a = new A(x: 0); let x = a.x; ! ?Object o = foo(x); /// Toplevel class A<T> { T x; } <T0> T0 foo(T0 x) = x; + + + /// FAIL + ?Object[] s0 = [null]; + Array<?> s = s0; + Object /*/// FAIL HERE */ o = s[0]; + o.toString(); + + /// FAIL + Set<?Object> s0 = new TreeSet(); + s0.add(null); + Set<?> s = s0; + for (k : s) + { + Object /*/// FAIL HERE */ o = foo(k); + o.toString(); + } + /// Toplevel + <T0> T0 foo(T0 x) = x; |
From: Daniel B. <bo...@us...> - 2005-06-17 14:14:17
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22896/src/mlsub/typing Modified Files: TupleType.java FunType.java Log Message: Do not allow a soft type variable to become greater than Object if it is already constrained to be smaller than another type, as that is obviously unsafe. Index: FunType.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/FunType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FunType.java 28 Feb 2003 20:52:13 -0000 1.9 --- FunType.java 17 Jun 2005 14:14:08 -0000 1.10 *************** *** 70,75 **** ****************************************************************/ ! public int getId() { throw new Error(); } ! public void setId(int value) { throw new Error(); } Kind kind; --- 70,75 ---- ****************************************************************/ ! public int getId() { return mlsub.typing.lowlevel.Engine.INVALID; } ! public void setId(int value) { throw new Error(); } Kind kind; Index: TupleType.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/TupleType.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TupleType.java 28 Feb 2003 20:52:12 -0000 1.6 --- TupleType.java 17 Jun 2005 14:14:08 -0000 1.7 *************** *** 53,58 **** ****************************************************************/ ! public int getId() { throw new Error(); } ! public void setId(int value) { throw new Error(); } final Kind kind; --- 53,58 ---- ****************************************************************/ ! public int getId() { return mlsub.typing.lowlevel.Engine.INVALID; } ! public void setId(int value) { throw new Error(); } final Kind kind; |
From: Daniel B. <bo...@us...> - 2005-06-17 14:14:17
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22896/src/mlsub/typing/lowlevel Modified Files: Engine.java Log Message: Do not allow a soft type variable to become greater than Object if it is already constrained to be smaller than another type, as that is obviously unsafe. Index: Engine.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Engine.java 9 Jun 2005 11:56:59 -0000 1.37 --- Engine.java 17 Jun 2005 14:14:08 -0000 1.38 *************** *** 269,278 **** rigid element, it will have its type. it is still possible for it to be greater than Top ! (and therefore equal to Top). For this, we just need to ! forget its previous kind. */ if (k1 == mlsub.typing.TopMonotype.TopKind.instance && e2 instanceof mlsub.typing.MonotypeVar && ! ! isRigid(e2)) { ((mlsub.typing.MonotypeVar) e2).resetKind(k1); --- 269,279 ---- rigid element, it will have its type. it is still possible for it to be greater than Top ! (and therefore equal to Top), provided it is "free upwards", ! that is, has no constraint to be smaller than another element. ! For this, we just need to forget its previous kind. */ if (k1 == mlsub.typing.TopMonotype.TopKind.instance && e2 instanceof mlsub.typing.MonotypeVar && ! ! isRigid(e2) && isFreeUpwards(e2)) { ((mlsub.typing.MonotypeVar) e2).resetKind(k1); *************** *** 341,344 **** --- 342,346 ---- } + public static final int INVALID = -1; private static final int FLOATING = -3; private static final int RIGID = -4; *************** *** 358,361 **** --- 360,388 ---- } + static boolean isFreeUpwards(Element e) + { + if (e instanceof mlsub.typing.Monotype) + { + mlsub.typing.Monotype m = (mlsub.typing.Monotype) e; + + // If there is a constructed equivalent, it is the one that + // has been getting the constraints (in particular its head). + m = m.equivalent(); + if (m.head() != null) + e = m.head(); + else + e = m; + } + + if (e.getId() == FLOATING) + /// XXX check frozen leqs? + return true; + + if (e.getId() < 0) + return false; + + return getConstraint(e.getKind()).isFreeUpwards(e); + } + /**************************************************************** * Simplification *************** *** 1001,1004 **** --- 1028,1046 ---- } + + boolean isFreeUpwards(Element e) + { + final int id = e.getId(); + + // If there is any i with a id <: i constraint, return false + // TODO: handle cases when id <: i where i is non rigid, but not free + // upwards + for (int i = 0; i < k0.firstNonRigid(); i++) + if (i != id && k0.wasEntered(id, i)) + return false; + + return true; + } + void mark() { |
From: Daniel B. <bo...@us...> - 2005-06-17 14:14:16
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22896/testsuite/compiler/typing Modified Files: object.testsuite Log Message: Do not allow a soft type variable to become greater than Object if it is already constrained to be smaller than another type, as that is obviously unsafe. Index: object.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/object.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** object.testsuite 12 Mar 2005 15:06:17 -0000 1.5 --- object.testsuite 17 Jun 2005 14:14:07 -0000 1.6 *************** *** 79,80 **** --- 79,98 ---- <T> T foo(T x) = x; foo(#String s) = /*/// FAIL HERE*/ o; + + /// FAIL + A<int> a = new A(x: 0); + /*/// FAIL HERE */ foo(a, new A(x: new Object())); + int x = a.x; + /// Toplevel + class A<T> { T x; } + <T> void foo(A<T> a1, A<T> a2) { a1.x = a2.x; } + + /// FAIL + let (Object[], int->?Object)->void /*/// FAIL HERE */ f = foo; + /// Toplevel + <T> void foo(List<T>,T) {} + + /// FAIL + let (?Object[], (int,int))->void /*/// FAIL HERE */ f = foo; + /// Toplevel + <T> void foo(List<T>,T) {} |
From: Daniel B. <bo...@us...> - 2005-06-17 11:10:01
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23799/src/nice/tools/testsuite Modified Files: TestNice.java Log Message: Detect automatically where the Nice runtime is. Index: TestNice.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** TestNice.java 17 Jun 2005 09:32:39 -0000 1.34 --- TestNice.java 17 Jun 2005 11:09:51 -0000 1.35 *************** *** 194,197 **** --- 194,200 ---- */ static public void main(String[] args) { + + _runtime = nice.tools.compiler.dispatch.getNiceRuntime(); + if (!processArgs(args)) { usage(); *************** *** 321,325 **** // When doing native compilation, we need a jarred runtime ! if (_runtime == null) _runtime = "share/java/nice.jar"; } --- 324,328 ---- // When doing native compilation, we need a jarred runtime ! if (_runtime == null || ! _runtime.endsWith(".jar")) _runtime = "share/java/nice.jar"; } *************** *** 583,590 **** static ClassLoader getClassLoader() { - // This is normally where the compiled classes are in the dev tree. - if (_runtime == null) - _runtime = "classes"; - File[] dirs = { getTempFolder(), new File(getRuntime()) }; ClassLoader res = new nice.tools.util.DirectoryClassLoader(dirs, null); --- 586,589 ---- |
From: Daniel B. <bo...@us...> - 2005-06-17 09:32:49
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8219/src/nice/tools/testsuite Modified Files: TestNice.java Log Message: Make sure to only call deleteFolder on directories (revealed by kaffe on a NFS filesystem). Index: TestNice.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** TestNice.java 4 Apr 2005 12:38:25 -0000 1.33 --- TestNice.java 17 Jun 2005 09:32:39 -0000 1.34 *************** *** 399,406 **** for(int i = 0; i < files.length; i++) { File file = files[i]; ! if (file.isFile()) ! file.delete(); ! else deleteFolder(file); } folder.delete(); --- 399,406 ---- for(int i = 0; i < files.length; i++) { File file = files[i]; ! if (file.isDirectory()) deleteFolder(file); + else + file.delete(); } folder.delete(); |
From: Daniel B. <bo...@us...> - 2005-06-16 16:12:28
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv631/src/bossa/syntax Modified Files: compilation.nice Log Message: Really find out the first argument to create a meaningful error message (a functional value was printed instead). Index: compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/compilation.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** compilation.nice 21 May 2005 16:24:58 -0000 1.9 --- compilation.nice 16 Jun 2005 16:12:19 -0000 1.10 *************** *** 206,210 **** String msg = m + " is a native method.\n"; ! if (maybeNull(firstArgument) == null) msg += "It cannot be implemented without dispatch on the first argument"; else --- 206,212 ---- String msg = m + " is a native method.\n"; ! ?mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); ! ! if (firstArgument == null) msg += "It cannot be implemented without dispatch on the first argument"; else |
From: Daniel B. <bo...@us...> - 2005-06-09 14:11:46
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26693/src/mlsub/typing Modified Files: MonotypeVar.java Log Message: Forward setUnknown to raw types in all cases. Index: MonotypeVar.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/MonotypeVar.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MonotypeVar.java 9 Jun 2005 11:57:00 -0000 1.21 --- MonotypeVar.java 9 Jun 2005 14:11:37 -0000 1.22 *************** *** 237,249 **** if (equivalent != null) { ! if (persistentKind == null) { ! if (! allowUnknown) ! throw mlsub.typing.lowlevel.LowlevelUnsatisfiable.instance; } else { ! Monotype raw = ((MonotypeConstructor) equivalent()).getTP()[0]; ! raw.setUnknown(leq, geq); } } --- 237,249 ---- if (equivalent != null) { ! if (kind == NullnessKind.instance) { ! Monotype raw = ((MonotypeConstructor) equivalent()).getTP()[0]; ! raw.setUnknown(leq, geq); } else { ! if (! allowUnknown) ! throw mlsub.typing.lowlevel.LowlevelUnsatisfiable.instance; } } |
From: Daniel B. <bo...@us...> - 2005-06-09 14:11:45
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26693/testsuite/compiler/typing Modified Files: wildcards.testsuite Log Message: Forward setUnknown to raw types in all cases. Index: wildcards.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/wildcards.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wildcards.testsuite 9 Jun 2005 11:56:59 -0000 1.4 --- wildcards.testsuite 9 Jun 2005 14:11:36 -0000 1.5 *************** *** 139,140 **** --- 139,149 ---- let cc = /*/// FAIL HERE */ new Cons(head: 1, tail: c); } + + + /// PASS + A<?> a = new A(x: 0); + let x = a.x; + Object o = foo(x); + /// Toplevel + class A<T> { T x; } + <T0> T0 foo(T0 x) = x; |
From: Daniel B. <bo...@us...> - 2005-06-09 11:57:36
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20429/src/mlsub/typing/lowlevel Modified Files: Engine.java Log Message: Better implementation of wildcards (fixes #1216727). Index: Engine.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Engine.java 6 Apr 2005 20:38:39 -0000 1.36 --- Engine.java 9 Jun 2005 11:56:59 -0000 1.37 *************** *** 291,294 **** --- 291,296 ---- { setKind(e2,k1); + if (e2 instanceof mlsub.typing.MonotypeVar) + ((mlsub.typing.MonotypeVar) e2).allowUnknownTypeParameters(); k1.leq(e1,e2,initial); } |
From: Daniel B. <bo...@us...> - 2005-06-09 11:57:35
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20429/src/mlsub/typing Modified Files: Variance.java NullnessKind.java MonotypeVar.java Monotype.java Log Message: Better implementation of wildcards (fixes #1216727). Index: Variance.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Variance.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Variance.java 25 May 2005 23:22:57 -0000 1.18 --- Variance.java 9 Jun 2005 11:57:00 -0000 1.19 *************** *** 256,260 **** if (tp1[i].isUnknown()) { ! tp2[i].setUnknown(); continue; } --- 256,260 ---- if (tp1[i].isUnknown()) { ! tp2[i].setUnknown(true, true); continue; } Index: MonotypeVar.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/MonotypeVar.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MonotypeVar.java 27 May 2005 13:59:47 -0000 1.20 --- MonotypeVar.java 9 Jun 2005 11:57:00 -0000 1.21 *************** *** 201,213 **** } private boolean unknown; boolean isUnknown() { return unknown; } ! void setUnknown() throws mlsub.typing.lowlevel.Unsatisfiable { if (equivalent != null) ! equivalent.setUnknown(); equivalent = UnknownMonotype.instance; --- 201,251 ---- } + /** + True when this variable was created during the decomposition of T + into T0<T1,...> caused by a constraint A<B1,...> <: T + This a priori implies T1 = B1 (supposing A is invariant, but the + allowUnknown variable marks that T1=? (UnknownMonotype) is also a + valid solution. + */ + private boolean allowUnknown = false; + + /** + Allow this type's type parameters to be changed to the unknown type. + */ + public void allowUnknownTypeParameters() + { + if (equivalent instanceof MonotypeConstructor) + { + MonotypeVar[] tps = (MonotypeVar[]) ((MonotypeConstructor) equivalent).getTP(); + if (tps != null) + for (int i = 0; i < tps.length; i++) + { + tps[i].allowUnknown = true; + if (tps[i].equivalent != null) + tps[i].allowUnknownTypeParameters(); + } + } + } + private boolean unknown; boolean isUnknown() { return unknown; } ! void setUnknown(boolean leq, boolean geq) throws mlsub.typing.lowlevel.Unsatisfiable { if (equivalent != null) ! { ! if (persistentKind == null) ! { ! if (! allowUnknown) ! throw mlsub.typing.lowlevel.LowlevelUnsatisfiable.instance; ! } ! else ! { ! Monotype raw = ((MonotypeConstructor) equivalent()).getTP()[0]; ! raw.setUnknown(leq, geq); ! } ! } equivalent = UnknownMonotype.instance; Index: NullnessKind.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/NullnessKind.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NullnessKind.java 31 May 2005 07:32:50 -0000 1.7 --- NullnessKind.java 9 Jun 2005 11:57:00 -0000 1.8 *************** *** 45,52 **** introduce(tc); ! Monotype raw = new MonotypeVar(existential); Typing.introduce(raw); ! return new MonotypeConstructor(tc, new Monotype[]{ raw }); } --- 45,52 ---- introduce(tc); ! MonotypeVar raw = new MonotypeVar(existential); Typing.introduce(raw); ! return new MonotypeConstructor(tc, new MonotypeVar[]{ raw }); } *************** *** 62,68 **** so that for the syntactic type <T> ... !T we don't end up printing !t9. */ ! Monotype raw = new MonotypeVar(base.getName()); ! return new MonotypeConstructor(tc, new Monotype[]{ raw }); } --- 62,68 ---- so that for the syntactic type <T> ... !T we don't end up printing !t9. */ ! MonotypeVar raw = new MonotypeVar(base.getName()); ! return new MonotypeConstructor(tc, new MonotypeVar[]{ raw }); } *************** *** 98,107 **** if (m1.isUnknown()) { ! m2.setUnknown(); return; } if (m2.isUnknown()) ! throw LowlevelUnsatisfiable.instance; MonotypeConstructor mc1 = mc(m1), mc2 = mc(m2); --- 98,110 ---- if (m1.isUnknown()) { ! m2.setUnknown(false, true); return; } if (m2.isUnknown()) ! { ! m1.setUnknown(true, false); ! return; ! } MonotypeConstructor mc1 = mc(m1), mc2 = mc(m2); Index: Monotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Monotype.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Monotype.java 30 Jul 2004 19:08:45 -0000 1.11 --- Monotype.java 9 Jun 2005 11:57:00 -0000 1.12 *************** *** 123,131 **** boolean isUnknown() { return false; } ! void setUnknown() throws mlsub.typing.lowlevel.Unsatisfiable { ! mlsub.typing.lowlevel.Engine.leq ! (TopMonotype.instance, nice.tools.typing.Types.rawType(this)); } --- 123,137 ---- boolean isUnknown() { return false; } ! void setUnknown(boolean leq, boolean geq) throws mlsub.typing.lowlevel.Unsatisfiable { ! if (leq) ! throw mlsub.typing.lowlevel.LowlevelUnsatisfiable.instance; ! ! if (geq) ! { ! Monotype raw = nice.tools.typing.Types.rawType(this); ! mlsub.typing.lowlevel.Engine.leq(TopMonotype.instance, raw); ! } } |
From: Daniel B. <bo...@us...> - 2005-06-09 11:57:12
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20429/testsuite/compiler/typing Modified Files: wildcards.testsuite Log Message: Better implementation of wildcards (fixes #1216727). Index: wildcards.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/wildcards.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wildcards.testsuite 31 May 2005 07:32:49 -0000 1.3 --- wildcards.testsuite 9 Jun 2005 11:56:59 -0000 1.4 *************** *** 37,40 **** --- 37,45 ---- + /// PASS + /// Toplevel + class A<T0> { T0 x; } + Object foo(A<?> a) = a.x; + /// FAIL A<int,String> a = new A(x1: 0, x2: ""); *************** *** 74,75 **** --- 79,140 ---- void foo(A<?> a) = bar(a.x); <T> void bar(T x) {} + + /// FAIL + A<int> a1 = new A(x: 0); + A<String> a2 = new A(x: ""); + foo(a1, a2); + int x = a1.x; + /// Toplevel + class A<T> { T x; } + + void foo(A<int> a1, A<?> a2) = /*/// FAIL HERE */ splash(a1, a2); + + <T> void splash(A<T> a1, A<T> a2) + { + a1.x = a2.x; + } + + + /// FAIL + A<B<String>> a = new A(x: new B(y: "")); + /*/// FAIL HERE */ foo(a); + String s = a.x.y; + + /// Toplevel + class A<T> { T x; } + class B<T> { T y; } + + void foo(A<B<?>> a) { a.x = new B(y: 0); } + + /// PASS + foo(new A(x: new B(y: ""))); + + /// Toplevel + class A<TA> { TA x; } + class B<TB> { TB y; } + + void foo(A<B<?>> a) {} + + /// FAIL + A<String>[] as = [new A(x: "")]; + /*/// FAIL HERE */ getM(as); + String s = as[0].x; + /// Toplevel + class A<T> { T x; } + + void getM(A<?>[] a) { a[0] = new A(x: 0); } + + + /// FAIL + // bug #1216727 + /// Toplevel + class Cons<TT> { + TT head; + Cons<TT> tail; + boolean isEmpty() = false; + } + + void _testEmpty(Cons<?> c) + { + let cc = /*/// FAIL HERE */ new Cons(head: 1, tail: c); + } |
From: Daniel B. <bo...@us...> - 2005-06-09 08:29:08
|
Update of /cvsroot/nice/Nice/distrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4705/distrib Modified Files: .cvsignore Log Message: Ignore *.tgz Index: .cvsignore =================================================================== RCS file: /cvsroot/nice/Nice/distrib/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .cvsignore 12 Nov 2003 21:33:07 -0000 1.3 --- .cvsignore 9 Jun 2005 08:28:58 -0000 1.4 *************** *** 2,5 **** --- 2,6 ---- Nice-*.tar *.tar.gz + *.tgz # Debian |