Skip to content

Cannot return a generic type #42

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions