[ nice-Bugs-1090679 ] no type error, but should be

"SourceForge.net" <[email protected]> Thu, 23 Dec 2004 19:03:39 -0800
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #1090679, was opened at 2004-12-23 22:03
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=1090679&group_id=12788

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: mike.beckerle (mbeckerle)
Assigned to: Nobody/Anonymous (nobody)
Summary: no type error, but should be

Initial Comment:

I have a runtime error that should be a type error at 
compile time:

package bug1;

(?int, int) foo(byte by, int pos) {
  if ((by & 0x80) == 0x80) {
    return (null, pos);
  } 
  return (by, pos);
}


void _test_foo() {
 var ?int charcode = null;
 var int pos = 0;
 var res = foo(65, 0);
 (charcode, pos) =  res;
 println(charcode); //prints 65
 // assert(charcode != null); 
 assert(charcode == 65); // Fails, at run time. Succeeds 
if above assert is not commented out.
 // assert(charcode == new java.lang.Integer(65)); // 
also fails same way
 // I think the above should fail to typecheck at compile 
time since ?int == int should fail to check.
 assert(pos == 0);
}
 


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1090679&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/