Hi Russel,

The “trick” is to know that the range 1 .. 0 is the canonical empty range (one 
of
many of course).  So then

> cat foo.chpl
proc main() {
  var empty : [1 .. 0] real;

  writeln('numElements: ', empty.numElements);
}


> chpl -o foo foo.chpl
> 

> ./foo
numElements: 0


Regards,

Mike




> On Sep 3, 2016, at 9:49 AM, Russel Winder <[email protected]> wrote:
> 
> In trying to define an empty, zero length array, I tried the program:
> 
>    proc main() {
>      const emptyArray: [?] real;
>    }
> 
> but it gave me the error:
> 
> |> chpl incorrectArrayDeclaration.chpl 
> incorrectArrayDeclaration.chpl:2: internal error: CAL0057 chpl Version 
> 1.13.1.8b51523
> Note: This source location is a guess.
> 
> Internal errors indicate a bug in the Chapel compiler ("It's us, not you"),
> and we're sorry for the hassle.  We would appreciate your reporting this bug 
> -- 
> please see http://chapel.cray.com/bugs.html for instructions.  In the 
> meantime,
> the filename + line number above may be useful in working around the issue.
> 
> 
> -- 
> Russel.
> =============================================================================
> Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[email protected]
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
> London SW11 1EN, UK   w: www.russel.org.uk  skype: 
> russel_winder------------------------------------------------------------------------------
> _______________________________________________
> Chapel-bugs mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/chapel-bugs

------------------------------------------------------------------------------
_______________________________________________
Chapel-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-bugs

Reply via email to