basmith / stab-language

Automatically exported from code.google.com/p/stab-language
Apache License 2.0
0 stars 0 forks source link

Cannot get the length of an array #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
How to get the length of an array ? The following code does not compile

using java.io;
using java.net;
using java.util;
using java.lang;

package test {

    public class Main {

        public static void main(String[] args){
            System.out.println(new Integer[10].length);

            System.out.println("DONE");
        }
    }
}

Original issue reported on code.google.com by ice.ta...@gmail.com on 29 Sep 2010 at 9:58

GoogleCodeExporter commented 8 years ago
Java pseudo-fields 'length' and 'class' have been replaced in Stab by sizeof() 
and typeof():

System.out.println(sizeof(new Integer[10]));

Original comment by stab.hac...@gmail.com on 29 Sep 2010 at 6:23