managed-commons / stab-language

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

Cannot return a generic type #42

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following code:

using java.lang;
using java.util;

package test {

    public class TemplateMapper<E> where E : Enum<E> {

        private int v;

        enum Code {
            Code1
        }

        public TemplateMapper(int v){
            this.v = v;
        }

        public E getCode(int code) {
            return getCode(Integer.valueOf(code));
        }

        public E getCode(Number code) {
            return Code.Code1;
        }

    }
}

returns the error:

error 237: Cannot apply invocation to any method, delegate or extension method

Original issue reported on code.google.com by ice.ta...@gmail.com on 27 Feb 2011 at 12:55