The issue was due to missing compiler flag. To make validation annotations work correctly on generic types, just enable the -Xemit-jvm-type-annotations compiler flag.
-Xemit-jvm-type-annotations