nice-commit Mailing List for The Nice Programming Language (Page 6)
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-05-25 23:23:05
|
Update of /cvsroot/nice/Nice/src/nice/tools/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2569/src/nice/tools/typing Modified Files: Types.java Log Message: Fix subtyping of wildcards. Should be safe, but overrestrictive, since a wildcard is now not a subtype of itself. Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/typing/Types.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Types.java 24 May 2005 19:14:56 -0000 1.15 --- Types.java 25 May 2005 23:22:57 -0000 1.16 *************** *** 99,103 **** { m = m.equivalent(); ! if (! (m.getKind() == NullnessKind.instance)) return m; --- 99,103 ---- { m = m.equivalent(); ! if (m.getKind() != NullnessKind.instance || m == UnknownMonotype.instance) return m; |
From: Daniel B. <bo...@us...> - 2005-05-25 23:23:05
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2569/src/mlsub/typing/lowlevel Modified Files: LowlevelUnsatisfiable.java Log Message: Fix subtyping of wildcards. Should be safe, but overrestrictive, since a wildcard is now not a subtype of itself. Index: LowlevelUnsatisfiable.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/LowlevelUnsatisfiable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LowlevelUnsatisfiable.java 29 Mar 2005 15:33:03 -0000 1.2 --- LowlevelUnsatisfiable.java 25 May 2005 23:22:57 -0000 1.3 *************** *** 7,11 **** public class LowlevelUnsatisfiable extends Unsatisfiable { ! LowlevelUnsatisfiable(String msg) { super(msg); --- 7,11 ---- public class LowlevelUnsatisfiable extends Unsatisfiable { ! public LowlevelUnsatisfiable(String msg) { super(msg); *************** *** 17,21 **** } ! static LowlevelUnsatisfiable instance = new LowlevelUnsatisfiable(); static boolean refinedReports = true; --- 17,21 ---- } ! public static LowlevelUnsatisfiable instance = new LowlevelUnsatisfiable(); static boolean refinedReports = true; |
From: Daniel B. <bo...@us...> - 2005-05-25 23:23:05
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2569/testsuite/compiler/typing Modified Files: wildcards.testsuite Log Message: Fix subtyping of wildcards. Should be safe, but overrestrictive, since a wildcard is now not a subtype of itself. Index: wildcards.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/wildcards.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wildcards.testsuite 25 May 2005 15:26:17 -0000 1.1 --- wildcards.testsuite 25 May 2005 23:22:56 -0000 1.2 *************** *** 16,17 **** --- 16,69 ---- (a.x1, a.x2) = (a.x2, a.x1); } + + /// PASS + /// Toplevel + class A<T> { T x1; T x2; } + void swap(A<?> a) + { + let tmp = a.x1; + a.x1 = a.x2; + a.x2 = tmp; + } + + /// FAIL + A<int> a = new A(x: 0); + A<?> aa = a; + /*/// FAIL HERE */ aa.x = ""; + int i = a.x; + + /// Toplevel + class A<T> { T x; } + + + /// FAIL + A<int,String> a = new A(x1: 0, x2: ""); + splash(a); + int i = a.x1; + + /// Toplevel + class A<T1,T2> { T1 x1; T2 x2; } + void splash(A<?,?> a) { + /*/// FAIL HERE */ a.x1 = a.x2; + } + + /// FAIL + A<int,String> a = new A(x1: 0, x2: ""); + splash(a); + String s = a.x2; + + /// Toplevel + class A<T1,T2> { T1 x1; T2 x2; } + void splash(A<?,?> a) { + /*/// FAIL HERE */ a.x2 = a.x1; + } + + /// FAIL + A<int,String> a = new A(x1: 0, x2: ""); + splash(a); + + /// Toplevel + class A<T1,T2> { T1 x1; T2 x2; } + void splash(A<?,?> a) { + int /*/// FAIL HERE */ x = a.x2; + } |
From: Daniel B. <bo...@us...> - 2005-05-25 22:26:04
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24475 Modified Files: Makefile Log Message: Fix for the previous patch, which failed when dispatch.java was not present Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** Makefile 25 May 2005 22:20:28 -0000 1.165 --- Makefile 25 May 2005 22:25:54 -0000 1.166 *************** *** 135,139 **** if [ -r src/bossa/syntax/dispatch.java -a ! -r src/bossa/syntax/dispatch.java.bootstrap ]; then \ mv src/bossa/syntax/dispatch.java src/bossa/syntax/dispatch.java.bootstrap; fi ! [ -r src/bossa/syntax/dispatch.java ] && rm src/bossa/syntax/dispatch.java find . \( -name "*.class" -o -name "*.nicei" -o -name "*~" \) -exec rm {} \; --- 135,139 ---- if [ -r src/bossa/syntax/dispatch.java -a ! -r src/bossa/syntax/dispatch.java.bootstrap ]; then \ mv src/bossa/syntax/dispatch.java src/bossa/syntax/dispatch.java.bootstrap; fi ! rm -f src/bossa/syntax/dispatch.java find . \( -name "*.class" -o -name "*.nicei" -o -name "*~" \) -exec rm {} \; |
From: Daniel B. <bo...@us...> - 2005-05-25 22:20:50
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22492 Modified Files: Makefile Log Message: Correctly handle cleaning when both dispatch.java and dispatch.java.bootstrap exist. This can happen in particular if dispatch.java exists, and a new version of dispatch.java.bootstrap is obtained with cvs update. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** Makefile 11 Apr 2005 12:45:36 -0000 1.164 --- Makefile 25 May 2005 22:20:28 -0000 1.165 *************** *** 133,137 **** rm -rf classes classes-inline share/java src/bossa/parser/{Parse*.java,Token*.java,*CharStream.java} rm -f bin/{nicedoc,niceunit} ! [ -r src/bossa/syntax/dispatch.java ] && mv src/bossa/syntax/dispatch.java src/bossa/syntax/dispatch.java.bootstrap || true find . \( -name "*.class" -o -name "*.nicei" -o -name "*~" \) -exec rm {} \; --- 133,139 ---- rm -rf classes classes-inline share/java src/bossa/parser/{Parse*.java,Token*.java,*CharStream.java} rm -f bin/{nicedoc,niceunit} ! if [ -r src/bossa/syntax/dispatch.java -a ! -r src/bossa/syntax/dispatch.java.bootstrap ]; then \ ! mv src/bossa/syntax/dispatch.java src/bossa/syntax/dispatch.java.bootstrap; fi ! [ -r src/bossa/syntax/dispatch.java ] && rm src/bossa/syntax/dispatch.java find . \( -name "*.class" -o -name "*.nicei" -o -name "*~" \) -exec rm {} \; |
From: Daniel B. <bo...@us...> - 2005-05-25 15:26:28
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1897/testsuite/compiler/typing Added Files: wildcards.testsuite Log Message: Simple tests for wildcard types. --- NEW FILE: wildcards.testsuite --- /// PASS A<int> ai = new A(); A<String> as = new A(); foo(ai); foo(as); /// Toplevel class A<T> {} void foo(A<?>) {} /// PASS /// Toplevel class A<T> { T x1; T x2; } void swap(A<?> a) { (a.x1, a.x2) = (a.x2, a.x1); } |
From: Daniel B. <bo...@us...> - 2005-05-25 11:52:43
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18588/src/bossa/parser Modified Files: Parser.jj Log Message: Consistently use '?' to represent the wildcard (unknown monotype). Only accept it in the parser as a type parameter (Object can as well be used to mean "any monotype"). Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.329 retrieving revision 1.330 diff -C2 -d -r1.329 -r1.330 *** Parser.jj 10 Apr 2005 14:57:02 -0000 1.329 --- Parser.jj 25 May 2005 11:52:30 -0000 1.330 *************** *** 225,229 **** | < FALSE: "false" > | < ALIKE: "alike" > /* Nice specific */ - | < UNKNOWN: "unknown" > /* Nice specific */ //| < THIS: "this" > | < SUPER: "super" > --- 225,228 ---- *************** *** 705,709 **** t=typeConstructorIdent() ! "<" [ p=monotypes() ] ">" { if(p==null) p=new ArrayList(0); last=getToken(0); --- 704,708 ---- t=typeConstructorIdent() ! "<" [ p=typeParameters() ] ">" { if(p==null) p=new ArrayList(0); last=getToken(0); *************** *** 824,829 **** { [ - // Consume "?" only if it does not appear by itself - LOOKAHEAD( "?", { getToken(2).kind != COMMA && getToken(2).kind != GT}) start="?" { maybe = true; } | start="!" { sure = true; } --- 823,826 ---- *************** *** 833,837 **** res=funOrTupleMonotype() | ! start="alike" [ "<" p=monotypes() ">" ] { res=bossa.syntax.dispatch.createAlike(p, makeLocation(start)); } { res.nullness = bossa.syntax.fun.nullness_absent; } --- 830,834 ---- res=funOrTupleMonotype() | ! start="alike" [ "<" p=typeParameters() ">" ] { res=bossa.syntax.dispatch.createAlike(p, makeLocation(start)); } { res.nullness = bossa.syntax.fun.nullness_absent; } *************** *** 855,861 **** } { return res; } - | - ("unknown" | "?") - { return new MonotypeWrapper(mlsub.typing.UnknownMonotype.instance); } } --- 852,855 ---- *************** *** 871,874 **** --- 865,891 ---- } + Monotype typeParameter(): + { + Monotype res; + } + { + // Consume "?" only if it appears by itself + LOOKAHEAD( "?", { getToken(2).kind == COMMA || getToken(2).kind == GT}) + "?" { return new MonotypeWrapper(mlsub.typing.UnknownMonotype.instance); } + | + res=monotype() { return res; } + } + + List typeParameters(): + { + List res=new ArrayList(); + Monotype t; + } + { + t=typeParameter() { res.add(t); } + ( "," t=typeParameter() { res.add(t); } )* + { return res; } + } + /***********************************************************************/ /* Visibility */ *************** *** 999,1005 **** { name=typeIdent() ! // ignore type parameters ! // they should be checked ! [ "<" params = monotypes() ">" ] { return bossa.syntax.fun.createMonotypeConstructor(name, params == null ? null : bossa.syntax.dispatch.createTypeParameters(params), name.location()); } } --- 1016,1020 ---- { name=typeIdent() ! [ "<" params = typeParameters() ">" ] { return bossa.syntax.fun.createMonotypeConstructor(name, params == null ? null : bossa.syntax.dispatch.createTypeParameters(params), name.location()); } } |
From: Daniel B. <bo...@us...> - 2005-05-25 11:52:41
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18588/src/mlsub/typing Modified Files: UnknownMonotype.java Log Message: Consistently use '?' to represent the wildcard (unknown monotype). Only accept it in the parser as a type parameter (Object can as well be used to mean "any monotype"). Index: UnknownMonotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/UnknownMonotype.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UnknownMonotype.java 28 Nov 2004 14:00:23 -0000 1.2 --- UnknownMonotype.java 25 May 2005 11:52:30 -0000 1.3 *************** *** 38,42 **** void tag(int variance) {} ! public String toString() { return "unknown"; } /**************************************************************** --- 38,42 ---- void tag(int variance) {} ! public String toString() { return "?"; } /**************************************************************** |
From: Daniel B. <bo...@us...> - 2005-05-25 11:52:41
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18588/testsuite/compiler/syntax Modified Files: types.testsuite Log Message: Consistently use '?' to represent the wildcard (unknown monotype). Only accept it in the parser as a type parameter (Object can as well be used to mean "any monotype"). Index: types.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/types.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** types.testsuite 12 Mar 2005 02:41:42 -0000 1.6 --- types.testsuite 25 May 2005 11:52:30 -0000 1.7 *************** *** 88,89 **** --- 88,93 ---- s3' = null; s3' = [ null ]; + + /// FAIL + /// Toplevel + void getValue (? /*/// FAIL HERE*/, int) {} |
From: Daniel B. <bo...@us...> - 2005-05-24 19:58:10
|
Update of /cvsroot/nice/Nice/regtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5455/regtest Modified Files: regtest Log Message: Use en_US instead of french locale, since that's more "standard" (anything with latin1 characters is OK). Index: regtest =================================================================== RCS file: /cvsroot/nice/Nice/regtest/regtest,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** regtest 3 Apr 2005 10:40:15 -0000 1.30 --- regtest 24 May 2005 19:57:57 -0000 1.31 *************** *** 30,34 **** compile() { ! (cd ..; LC_CTYPE=french "$NICE_TOP"/bin/nicec \ -e -r -a regtest/"$1" -d . \ --classpath=".:${NICE_TOP}/classes" regtest."$1") --- 30,34 ---- compile() { ! (cd ..; LC_CTYPE=en_US "$NICE_TOP"/bin/nicec \ -e -r -a regtest/"$1" -d . \ --classpath=".:${NICE_TOP}/classes" regtest."$1") |
From: Daniel B. <bo...@us...> - 2005-05-24 19:15:08
|
Update of /cvsroot/nice/Nice/src/nice/tools/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29140/src/nice/tools/typing Modified Files: Types.java Log Message: Fix mergings involving the Object type. Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/typing/Types.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Types.java 8 Mar 2005 19:33:22 -0000 1.14 --- Types.java 24 May 2005 19:14:56 -0000 1.15 *************** *** 403,408 **** return m1; ! Monotype raw1 = equivalent(m1); ! Monotype raw2 = equivalent(m2); TypeConstructor head; --- 403,430 ---- return m1; ! Monotype raw = rawMerge(equivalent(m1), equivalent(m2)); ! if (raw == null) ! return null; ! ! TypeConstructor marker; ! if (isSure(m1) && isSure(m2)) ! marker = PrimitiveType.sureTC; ! else ! marker = PrimitiveType.maybeTC; ! ! Monotype res = new MonotypeConstructor(marker, new Monotype[]{raw}); ! return res; ! } ! ! private static Monotype rawMerge(Monotype raw1, Monotype raw2) ! { ! if (raw1 == raw2) ! return raw1; ! ! if (raw1 == TopMonotype.instance || raw2 == TopMonotype.instance) ! return TopMonotype.instance; ! ! TypeConstructor head1 = raw1.head(); ! TypeConstructor head2 = raw2.head(); TypeConstructor head; *************** *** 432,444 **** } ! Monotype raw = new MonotypeConstructor(head, args); ! ! TypeConstructor marker; ! if (isSure(m1) && isSure(m2)) ! marker = PrimitiveType.sureTC; ! else ! marker = PrimitiveType.maybeTC; ! ! return new MonotypeConstructor(marker, new Monotype[]{raw}); } } --- 454,458 ---- } ! return new MonotypeConstructor(head, args); } } |
From: Daniel B. <bo...@us...> - 2005-05-24 19:15:07
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing/inference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29140/testsuite/compiler/typing/inference Added Files: merging.testsuite Log Message: Fix mergings involving the Object type. --- NEW FILE: merging.testsuite --- /// PASS /// Toplevel let Object REMOVED = new Object(); int insertionIndex(Object key){ ?Object cur = null; if(cur == REMOVED) return (cur != null && cur != REMOVED) ? 1 : -1; return (cur != null && cur != REMOVED) ? 1 : -1; } /// PASS ?Object o = null; if (true) o = new Object(); else assert o instanceof String; Object x = o; /// PASS A a = new B(); if (true) assert a instanceof B; else assert a instanceof C; A aa = a; /// Toplevel class A {} class B extends A {} class C extends A {} |
From: Daniel B. <bo...@us...> - 2005-05-24 19:13:30
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing/inference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28262/testsuite/compiler/typing/inference Log Message: Directory /cvsroot/nice/Nice/testsuite/compiler/typing/inference added to the repository |
From: Artem Gr K. <ar...@us...> - 2005-05-21 16:25:08
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14762 Modified Files: NEWS Log Message: Emit method signatures into Nice interface classes. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** NEWS 8 Apr 2005 08:26:57 -0000 1.76 --- NEWS 21 May 2005 16:24:58 -0000 1.77 *************** *** 59,62 **** --- 59,64 ---- assert 0==1; // fails if assertions enabled * niceunit supports a --jar option to test jars. + * It is now possible to use Nice "interface" method from Java + (that is, method signatures are preserved in interface bytecode). -- |
From: Artem Gr K. <ar...@us...> - 2005-05-21 16:25:08
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14762/src/gnu/bytecode Modified Files: Method.java Log Message: Emit method signatures into Nice interface classes. Index: Method.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Method.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Method.java 2 Mar 2004 20:21:11 -0000 1.9 --- Method.java 21 May 2005 16:24:59 -0000 1.10 *************** *** 242,246 **** { ! if (code == null) throw new Error("Method "+this+" has no code"); //return; --- 242,246 ---- { ! if (code == null && !isAbstract()) throw new Error("Method "+this+" has no code"); //return; |
From: Artem Gr K. <ar...@us...> - 2005-05-21 16:25:07
|
Update of /cvsroot/nice/Nice/testsuite/compiler/abstractInterfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14762/testsuite/compiler/abstractInterfaces Added Files: reflection.testsuite Log Message: Emit method signatures into Nice interface classes. --- NEW FILE: reflection.testsuite --- /// COMMENT Testing interface method signatures (Java compatibility) /// PASS Simple.class.getMethod( "fun", [ String.class ] ); /// Toplevel interface Simple { void fun( String ); } /// PASS let fooI0 = Foo.class.getMethod( "i0", [] ); let fooI1 = Foo.class.getMethod( "i1", [ Integer.TYPE ] ); let fooI2 = Foo.class.getMethod( "i2", [ Integer.TYPE, Integer.TYPE ] ); let fooII = Foo.class.getMethod( "ii", [ Integer.TYPE ] ); let barII_1 = Bar.class.getMethod( "ii", [ Integer.TYPE ] ); let barII_2 = Bar.class.getMethod( "ii", [ String.class ] ); !assert ( fooI0.getModifiers() & java.lang.reflect.Modifier.ABSTRACT ) != 0; !assert ( barII_1.getModifiers() & java.lang.reflect.Modifier.ABSTRACT ) != 0; !assert ( barII_2.getModifiers() & java.lang.reflect.Modifier.ABSTRACT ) != 0; !assert fooI0.getDeclaringClass().equals( Foo.class ); !assert barII_1.getDeclaringClass().equals( Foo.class ); !assert barII_2.getDeclaringClass().equals( Bar.class ); Foo foo = new FooImpl(); !assert new Integer( 0 ).equals( fooI0.invoke( foo, [] ) ); !assert new Integer( 2 ).equals( fooI1.invoke( foo, [ new Integer( 1 ) ] ) ); !assert new Integer( 1 ).equals( fooI2.invoke( foo, [ new Integer( 4 ), new Integer( 3 ) ] ) ); !assert new Integer( 9 ).equals( fooII.invoke( foo, [ new Integer( 9 ) ] ) ); Bar bar = new BarImpl(); !assert new Integer( 0 ).equals( fooI0.invoke( bar, [] ) ); !assert new Integer( 2 ).equals( fooI1.invoke( bar, [ new Integer( 1 ) ] ) ); !assert new Integer( 1 ).equals( fooI2.invoke( bar, [ new Integer( 4 ), new Integer( 3 ) ] ) ); !assert new Integer( 9 ).equals( fooII.invoke( bar, [ new Integer( 9 ) ] ) ); !assert new Integer( 9 ).equals( barII_1.invoke( bar, [ new Integer( 9 ) ] ) ); !assert new Integer( 1 ).equals( barII_2.invoke( bar, [ "-" ] ) ); /// Toplevel interface Foo { int i0(); int i1( int ); int i2( int, int ); int ii( int ); } interface Bar extends Foo { int ii( String ); } class FooImpl implements Foo { i0() = 0; i1( i ) = i + 1; i2( i, j ) = i - j; ii( i ) = i; } class BarImpl extends FooImpl implements Bar { ii( String s ) = s.length(); } /// PASS let impl = new Impl(); A.class.getMethod( "foo", [ A.class ] ).invoke( impl, [ impl ] ).equals( "a" ); B.class.getMethod( "foo", [ B.class ] ).invoke( impl, [ impl ] ).equals( "b" ); C.class.getMethod( "foo", [ A.class ] ).invoke( impl, [ impl ] ).equals( "a" ); C.class.getMethod( "foo", [ B.class ] ).invoke( impl, [ impl ] ).equals( "b" ); C.class.getMethod( "foo", [ C.class ] ).invoke( impl, [ impl ] ).equals( "c" ); /// Toplevel interface A { String foo( A ); } interface B { String foo( B ); } interface C extends A,B { override String foo( C ); } class Impl implements C {} foo( Impl impl, A arg ) = "a"; foo( Impl impl, B arg ) = "b"; foo( Impl impl, C arg ) = "c"; |
From: Artem Gr K. <ar...@us...> - 2005-05-21 16:25:07
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14762/src/bossa/syntax Modified Files: compilation.nice modifiers.nice Log Message: Emit method signatures into Nice interface classes. Index: compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/compilation.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** compilation.nice 26 Mar 2005 15:33:02 -0000 1.8 --- compilation.nice 21 May 2005 16:24:58 -0000 1.9 *************** *** 23,32 **** [cast(gnu.bytecode.Type.string_type)]); ! public void compileNiceMethod(NiceMethod m, ! Stack<Alternative> sortedAlternatives, ! bossa.modules.Package module) ! { ! gnu.expr.LambdaExp lexp = m.getLambda(); ! // parameters of the alternative function are the same in each case, // so we compute them just once --- 23,30 ---- [cast(gnu.bytecode.Type.string_type)]); ! private void makeBody(NiceMethod m, ! gnu.expr.LambdaExp lexp, ! Stack<Alternative> sortedAlternatives){ ! // parameters of the alternative function are the same in each case, // so we compute them just once *************** *** 40,52 **** gnu.expr.Expression body = dispatchNiceMethod ! (sortedAlternatives.iterator(), ! m.javaReturnType(), m.javaReturnType().isVoid(), params); if (m.isMain()) body = beautifyUncaughtExceptions(body); ! nice.tools.code.Gen.setMethodBody(lexp, m.getContract().compile(body)); } ! private gnu.expr.Expression dispatchNiceMethod(Iterator<Alternative> sortedAlternatives, gnu.bytecode.Type returnType, --- 38,95 ---- gnu.expr.Expression body = dispatchNiceMethod ! (sortedAlternatives.iterator(), ! m.javaReturnType(), m.javaReturnType().isVoid(), params); if (m.isMain()) body = beautifyUncaughtExceptions(body); ! body = m.getContract().compile(body); ! nice.tools.code.Gen.setMethodBody(lexp, body); } ! ! public void compileNiceMethod(NiceMethod m, ! Stack<Alternative> sortedAlternatives, ! bossa.modules.Package module) ! { ! gnu.expr.LambdaExp lexp = m.getLambda(); ! ! makeBody( m, lexp, sortedAlternatives ); ! ! if(m.getArity() != 0){ ! ?NiceClass iface = getNiceClass(m.getArgTypes()[0]); ! if(iface != null && iface.isInterface() && ! ( m instanceof MethodWithDefault )){ ! ! // If alternative method is implementing an interface, ! // then generate a dispatch method as a class member, ! // for Java interface invocations to find the implementation. ! ! if(bossa.util.Debug.codeGeneration) ! bossa.util.Debug.println("Generating Nice interface signature for " iface ); ! String name = m.getName().toString(); ! let argTypes = m.javaArgTypes(); ! let retType = m.javaReturnType(); ! let fullName = m.getFullName(); ! gnu.expr.LambdaExp res = generateMethod ! (name, argTypes, retType, m.getSymbols(), toplevel: true, member: true); ! res.parameterCopies = cast(notNull(m.formalParameters()).getParameterCopies()); ! iface.addJavaMethod(res); ! ! for(alt : sortedAlternatives){ ! ?NiceClass cl = declaringClass(alt); ! if(cl == null) continue; ! if(bossa.util.Debug.codeGeneration) ! bossa.util.Debug.println("Generating Nice dispatch function (interface implementation) for " alt); ! ! res = generateMethod ! (name, argTypes, retType, m.getSymbols(), toplevel: true, member: true); ! res.parameterCopies = cast(notNull(m.formalParameters()).getParameterCopies()); ! res.addBytecodeAttribute(new gnu.bytecode.MiscAttr("id", fullName.getBytes())); ! makeBody( m, res, sortedAlternatives ); ! cl.addJavaMethod(res); ! } ! } ! } ! } ! private gnu.expr.Expression dispatchNiceMethod(Iterator<Alternative> sortedAlternatives, gnu.bytecode.Type returnType, *************** *** 146,150 **** } ! private NiceClass declaringClass(JavaMethod m, Alternative alt) { ?mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); --- 189,193 ---- } ! private ?NiceClass declaringClass(Alternative alt) { ?mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); *************** *** 153,161 **** if (def != null && def.getImplementation() instanceof NiceClass) return cast(def.getImplementation()); // Explain that this cannot be done. String msg = m + " is a native method.\n"; ! if (firstArgument == null) msg += "It cannot be implemented without dispatch on the first argument"; else --- 196,210 ---- if (def != null && def.getImplementation() instanceof NiceClass) return cast(def.getImplementation()); + return null; + } + + private NiceClass declaringClass(JavaMethod m, Alternative alt) + { + let cl = declaringClass(alt); if(cl != null) return cl; // Explain that this cannot be done. String msg = m + " is a native method.\n"; ! if (maybeNull(firstArgument) == null) msg += "It cannot be implemented without dispatch on the first argument"; else Index: modifiers.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/modifiers.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** modifiers.nice 25 Nov 2004 19:28:18 -0000 1.1 --- modifiers.nice 21 May 2005 16:24:58 -0000 1.2 *************** *** 126,129 **** --- 126,132 ---- { this.setModifier( INTERFACE ); + // "Every interface is implicitly abstract", + // The Java⢠Language Specification Third Edition, 9.1.1.1 + this.setModifier( ABSTRACT ); } *************** *** 152,156 **** if( this.getModifier( TRANSIENT ) ) buf.append(" transient"); if( this.getModifier( NATIVE ) ) buf.append(" native"); ! if( this.getModifier( ABSTRACT ) ) buf.append(" abstract"); return buf.toString(); } --- 155,160 ---- if( this.getModifier( TRANSIENT ) ) buf.append(" transient"); if( this.getModifier( NATIVE ) ) buf.append(" native"); ! if( ! this.getModifier( INTERFACE ) ) ! if( this.getModifier( ABSTRACT ) ) buf.append(" abstract"); return buf.toString(); } |
From: Artem Gr K. <ar...@us...> - 2005-05-21 16:25:06
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14762/src/gnu/expr Modified Files: LambdaExp.java Log Message: Emit method signatures into Nice interface classes. Index: LambdaExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/LambdaExp.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** LambdaExp.java 20 Feb 2005 22:09:39 -0000 1.30 --- LambdaExp.java 21 May 2005 16:24:57 -0000 1.31 *************** *** 1526,1536 **** } } ! comp.method.initCode(); ! allocChildClasses(comp); ! allocParameters(comp); ! enterFunction(comp); ! compileBody(comp); ! compileEnd(comp); } } --- 1526,1540 ---- } } ! if (comp.curClass.isInterface() && comp.method.isAbstract()){ ! // Interface method. Skip code generation. ! }else{ ! comp.method.initCode(); ! allocChildClasses(comp); ! allocParameters(comp); ! enterFunction(comp); ! compileBody(comp); ! compileEnd(comp); ! } } } |
From: Artem Gr K. <ar...@us...> - 2005-05-06 08:37:11
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3723 Modified Files: build.xml Log Message: Formatting changed a bit. Index: build.xml =================================================================== RCS file: /cvsroot/nice/Nice/build.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** build.xml 18 Apr 2005 10:37:42 -0000 1.11 --- build.xml 6 May 2005 08:37:01 -0000 1.12 *************** *** 23,28 **** debug="on" optimize="yes" ! compiler="${compiler}" ! /> </sequential> </macrodef> --- 23,27 ---- debug="on" optimize="yes" ! compiler="${compiler}" /> </sequential> </macrodef> *************** *** 36,41 **** debug="on" optimize="yes" ! compiler="${compiler}" ! > <include /> </javac> --- 35,39 ---- debug="on" optimize="yes" ! compiler="${compiler}"> <include /> </javac> *************** *** 51,56 **** fork="yes" classpath="@{runtime}" ! classname="nice.tools.compiler.console.dispatch" ! > <jvmarg line="${jvmArgs}" /> <arg value="--sourcepath" /> --- 49,53 ---- fork="yes" classpath="@{runtime}" ! classname="nice.tools.compiler.console.dispatch"> <jvmarg line="${jvmArgs}" /> <arg value="--sourcepath" /> *************** *** 73,78 **** fork="yes" classpath="@{runtime}" ! classname="nice.tools.compiler.console.dispatch" ! > <jvmarg line="${jvmArgs}" /> <arg value="--sourcepath" /> --- 70,74 ---- fork="yes" classpath="@{runtime}" ! classname="nice.tools.compiler.console.dispatch"> <jvmarg line="${jvmArgs}" /> <arg value="--sourcepath" /> *************** *** 107,112 **** <move file="src/bossa/syntax/dispatch.java.bootstrap" tofile="src/bossa/syntax/dispatch.java" ! failonerror="no" ! /> <mac-javac-single includes="nice/tools/util/System.java" /> <mac-nicec-old package="nice.tools.repository" args="-R" /> --- 103,107 ---- <move file="src/bossa/syntax/dispatch.java.bootstrap" tofile="src/bossa/syntax/dispatch.java" ! failonerror="no" /> <mac-javac-single includes="nice/tools/util/System.java" /> <mac-nicec-old package="nice.tools.repository" args="-R" /> *************** *** 131,136 **** <move file="src/bossa/syntax/dispatch.java" tofile="src/bossa/syntax/dispatch.java.bootstrap" ! failonerror="no" ! /> <delete file="${build}/bossa/syntax/dispatch.class" /> <mac-nicec-old package="bossa.syntax" args="-r" /> --- 126,130 ---- <move file="src/bossa/syntax/dispatch.java" tofile="src/bossa/syntax/dispatch.java.bootstrap" ! failonerror="no" /> <delete file="${build}/bossa/syntax/dispatch.class" /> <mac-nicec-old package="bossa.syntax" args="-r" /> *************** *** 211,216 **** <target name="compiler1" depends="core-bootstrap,javacc,parser,recompile,setDate,compiler" ! description="build intermediate compiler" ! /> <target name="compiler2" depends="initialize"> <!-- Rebuild the compiler with itself. --> --- 205,209 ---- <target name="compiler1" depends="core-bootstrap,javacc,parser,recompile,setDate,compiler" ! description="build intermediate compiler" /> <target name="compiler2" depends="initialize"> <!-- Rebuild the compiler with itself. --> *************** *** 277,282 **** classname="nice.tools.testsuite.TestNice" fork="yes" ! failonerror="${checkFail}" ! > <jvmarg line="${jvmArgs}" /> <arg value="testsuite/compiler" /> --- 270,274 ---- classname="nice.tools.testsuite.TestNice" fork="yes" ! failonerror="${checkFail}"> <jvmarg line="${jvmArgs}" /> <arg value="testsuite/compiler" /> *************** *** 287,292 **** classname="nice.tools.testsuite.TestNice" fork="yes" ! failonerror="${checkFail}" ! > <jvmarg line="${jvmArgs}" /> <arg value="testsuite/lib" /> --- 279,283 ---- classname="nice.tools.testsuite.TestNice" fork="yes" ! failonerror="${checkFail}"> <jvmarg line="${jvmArgs}" /> <arg value="testsuite/lib" /> *************** *** 298,303 **** classname="nice.tools.testsuite.dispatch" fork="yes" ! failonerror="${checkFail}" ! > <jvmarg line="${jvmArgs}" /> </java> --- 289,293 ---- classname="nice.tools.testsuite.dispatch" fork="yes" ! failonerror="${checkFail}"> <jvmarg line="${jvmArgs}" /> </java> *************** *** 334,339 **** <move file="src/bossa/syntax/dispatch.java" tofile="src/bossa/syntax/dispatch.java.bootstrap" ! failonerror="no" ! /> </target> </project> --- 324,328 ---- <move file="src/bossa/syntax/dispatch.java" tofile="src/bossa/syntax/dispatch.java.bootstrap" ! failonerror="no" /> </target> </project> |
From: Artem Gr K. <ar...@us...> - 2005-05-06 07:24:20
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19751 Modified Files: Project Testsuite.test Log Message: Ant build requires NICE_JAR to point to the bootstrap Nice. Index: Testsuite.test =================================================================== RCS file: /cvsroot/nice/tester/Testsuite.test,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Testsuite.test 6 May 2005 05:43:09 -0000 1.3 --- Testsuite.test 6 May 2005 07:24:10 -0000 1.4 *************** *** 4,8 **** if [ "$ANT_BOOTSTRAP" ]; then ! /usr/bin/time -o TIME ant clean check > OUT else /usr/bin/time -o TIME make check > OUT --- 4,8 ---- if [ "$ANT_BOOTSTRAP" ]; then ! /usr/bin/time -o TIME ant check > OUT else /usr/bin/time -o TIME make check > OUT Index: Project =================================================================== RCS file: /cvsroot/nice/tester/Project,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Project 3 Apr 2005 03:30:05 -0000 1.13 --- Project 6 May 2005 07:24:10 -0000 1.14 *************** *** 10,17 **** if [ "$ANT_BOOTSTRAP" ]; then ! mkdir -p Nice/share/java ! cp Nice/external/nice-bootstrap.jar Nice/share/java/nice.jar cd Nice && ant jar ! exit $? fi --- 10,18 ---- if [ "$ANT_BOOTSTRAP" ]; then ! export NICE_JAR=${PWD}/Nice/external/nice-bootstrap.jar cd Nice && ant jar ! RES=$? ! export NICE_JAR=${PWD}/Nice/share/java/nice.jar ! exit $RES fi |
From: Artem Gr K. <ar...@us...> - 2005-05-06 05:43:24
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv529 Modified Files: Testsuite.test Log Message: Bootstrap again since 'classes' was lost in the process. Index: Testsuite.test =================================================================== RCS file: /cvsroot/nice/tester/Testsuite.test,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Testsuite.test 1 Apr 2005 15:09:15 -0000 1.2 --- Testsuite.test 6 May 2005 05:43:09 -0000 1.3 *************** *** 4,8 **** if [ "$ANT_BOOTSTRAP" ]; then ! /usr/bin/time -o TIME ant check > OUT else /usr/bin/time -o TIME make check > OUT --- 4,8 ---- if [ "$ANT_BOOTSTRAP" ]; then ! /usr/bin/time -o TIME ant clean check > OUT else /usr/bin/time -o TIME make check > OUT |
From: Artem Gr K. <ar...@us...> - 2005-04-18 19:05:09
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20098/src/bossa/syntax Modified Files: TypeScope.java Log Message: A workaround for the situation when a class with a '$' in its name is searched for with '.' instead of '$'. Index: TypeScope.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/TypeScope.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** TypeScope.java 6 Mar 2005 01:34:26 -0000 1.43 --- TypeScope.java 18 Apr 2005 19:04:58 -0000 1.44 *************** *** 106,110 **** TypeSymbol get(String name) { ! return (TypeSymbol) map.get(name); } --- 106,122 ---- TypeSymbol get(String name) { ! TypeSymbol typeSymbol = (TypeSymbol) map.get(name); ! if (typeSymbol != null) return typeSymbol; ! // A workaround required to find Nice classes having a '$' in the name. ! // Such classes are placed into the scope with their correct name, ! // but when looked up from the bytecode, the '$' is replaced with a '.'. ! // Therefore we'll try to replace '.' back into '$'. ! int dot; while (true) { ! dot = name.lastIndexOf('.'); ! if (-1 == dot) return null; ! name = name.substring(0,dot) + '$' + name.substring(dot+1); ! typeSymbol = (TypeSymbol) map.get(name); ! if (typeSymbol != null) return typeSymbol; ! } } |
From: Artem Gr K. <ar...@us...> - 2005-04-18 19:05:06
|
Update of /cvsroot/nice/Nice/testsuite/compiler/packages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20098/testsuite/compiler/packages Modified Files: inner-classes.testsuite Log Message: A workaround for the situation when a class with a '$' in its name is searched for with '.' instead of '$'. Index: inner-classes.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/packages/inner-classes.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inner-classes.testsuite 18 Apr 2005 18:23:08 -0000 1.1 --- inner-classes.testsuite 18 Apr 2005 19:04:58 -0000 1.2 *************** *** 1,3 **** ! /// PASS bug /// package a /// TOPLEVEL --- 1,3 ---- ! /// PASS /// package a /// TOPLEVEL |
From: Daniel B. <bo...@us...> - 2005-04-18 18:23:21
|
Update of /cvsroot/nice/Nice/testsuite/compiler/packages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32508/testsuite/compiler/packages Added Files: inner-classes.testsuite Log Message: Imported classes with a $ in their name are mishandled and end up being duplicated in the typechecker. --- NEW FILE: inner-classes.testsuite --- /// PASS bug /// package a /// TOPLEVEL // Original problem with a Comparator inner class // that can't be renamed because it was registered in a database. // That triggers a problem with special handling of '$' when traversing // bytecode, after wich the class is introduced into mlsub.typing twice: // as "a.Foo$Inner" and as "a.Foo.Inner". public class Foo { void nop( Class cl ){} void tryMe(){ this.nop( Foo$Inner.class ); } } public interface Itf { public void foo(); } public class Foo$Inner implements Itf { public foo(){} } /// package b import a new Foo().tryMe(); |
From: Daniel B. <bo...@us...> - 2005-04-18 18:03:38
|
Update of /cvsroot/nice/Nice/src/nice/tools/unit/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23650/src/nice/tools/unit/console Modified Files: main.nice Log Message: Report number of failures/tests at the end of a run. Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/unit/console/main.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.nice 8 Apr 2005 08:26:57 -0000 1.6 --- main.nice 18 Apr 2005 18:03:25 -0000 1.7 *************** *** 54,57 **** --- 54,59 ---- System.err.println("Package "pkg" was not found"); }); + + println(""listener.nFailures"/"listener.nTests" tests failed"); } *************** *** 66,73 **** class Listener implements TestListener { start(test) = println(test); ! end(test) {} failure(test, cause, loader) { println("Test failed:\n " + cause); if (!(iterLocations(test, cause, (?String file, String method, int line) => --- 68,79 ---- class Listener implements TestListener { + int nTests = 0; + int nFailures = 0; + start(test) = println(test); ! end(test) { nTests++; } failure(test, cause, loader) { + nFailures++; println("Test failed:\n " + cause); if (!(iterLocations(test, cause, (?String file, String method, int line) => |