[ nice-Bugs-1084559 ] exception in compiler

"SourceForge.net" <[email protected]> Mon, 13 Dec 2004 10:02:53 -0800
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #1084559, was opened at 2004-12-13 10:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1084559&group_id=12788

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: exception in compiler

Initial Comment:
hi,

while playing with the Nice compiler on JSDK 1.4.2_05,
Debian testing,
I get (for admittedly erroneous input(?))

$ PATH=/opt/nice-0.9.9/bin:${PATH} nicec --sourcepath
.. nice-test
nice.lang: parsing
nice-test: parsing

An exception has occured in the compiler
Please fill-in a bug report at the following webpage:
http://sourceforge.net/tracker/?func=add&group_id=12788&atid=112788

Stack trace:
Exception in thread "main" mlsub.typing.BadSizeEx: 1
expected, 0 given
        at
mlsub.typing.MonotypeConstructor.<init>(MonotypeConstructor.java:50)
        at
bossa.syntax.NiceMethod.create(NiceMethod.java:123)
        at
bossa.parser.Parser.internalMethodOrFunction(Parser.java:900)
        at
bossa.parser.Parser.classDefinition(Parser.java:1304)
        at bossa.parser.Parser.definition(Parser.java:2409)
        at
bossa.parser.Parser.readDefinitions(Parser.java:2446)
        at bossa.parser.Parser.module(Parser.java:3019)
        at
bossa.parser.JavaccParser.read(JavaccParser.java:70)
        at bossa.modules.Content.read(Content.java:111)
        at
bossa.modules.Content.getDefinitions(Content.java:86)
        at bossa.modules.Package.read(Package.java:121)
        at bossa.modules.Package.<init>(Package.java:87)
        at bossa.modules.Package.make(Package.java:58)
        at
bossa.modules.fun.setMainPackage(Compilation.nice:89)
        at
bossa.modules.Compilation.setMainPackage(Compilation.nice)
        at
nice.tools.compiler.fun.compile(interface.nice:38)
        at
bossa.modules.Compilation.compile(Compilation.nice)
        at
nice.tools.compiler.console.fun.compile(main.nice:165)
        at
nice.tools.compiler.console.dispatch.compile(dispatch.nice)
        at
nice.tools.compiler.console.fun.main(main.nice:181)
        at
nice.tools.compiler.console.dispatch.main(dispatch.nice)

$

The source is in part copied from the user's manual,
here it is.
regards, Georg [email protected]


interface Buffer<Elem>
{
  int size();

  boolean isFull();
  boolean isEmpty() ensures result == (size() == 0);

  void add(Elem element)
    requires
         !isfull() : "buffer must not be not full"  //
A comma here is optional
    ensures
         !isEmpty() : "buffer must not be empty",   //
Note the comma
         size() == old(size()) + 1 : "count inc";
}

class Aha extends Buffer<int> {

 String foo(int k)
   requires true;
 {
   Buffer<int> x = 0;
   
   return "";
 }
}


void main(String[] args) {
  println("Hello, " + foo(4));
}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1084559&group_id=12788


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/