grmartin / stab-language

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

Comparing enums of diferent types #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Is this code suported by the language?

    public class Main{
        public enum Type1 {
            INTEGER,
            VOID
        }

        public enum Type2 {
            INTEGER,
            VOID
        }

        public static void main( String[] args){

        System.out.println( (Type1.INTEGER == Type2.INTEGER)?"TRUE":"FALSE");

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

or should it throw an exception, because of the comparison on diferent types

Original issue reported on code.google.com by ice.ta...@gmail.com on 3 Jul 2010 at 2:19

GoogleCodeExporter commented 8 years ago
The compiler now reports errors for == and != used with operands of different 
enum types.

Original comment by stab.hac...@gmail.com on 5 Jul 2010 at 12:55