But then you could not do assignment like this
MyEnum<Int> blabla = valueOf("some double property");
because the types are not compatible. Also you want in that case to get null because you want to return MyEnum<Int> which does not exists for double property name and you cannot make that method work properly because of erasure.