@@ -123,15 +123,15 @@ public Object fromNative(Object result, FromNativeContext context) {
123123 //
124124 boolean ownsHandle = ((MethodResultContext ) context ).getMethod ().isAnnotationPresent (CallerOwnsReturn .class );
125125 int refadj = ownsHandle ? -1 : 0 ;
126- return NativeObject .objectFor ((Pointer ) result , context .getTargetType (), refadj , ownsHandle );
126+ return NativeObject .objectFor ((Pointer ) result , ( Class <? extends NativeObject >) context .getTargetType (), refadj , ownsHandle );
127127 }
128128 if (context instanceof CallbackParameterContext ) {
129- return NativeObject .objectFor ((Pointer ) result , context .getTargetType (), 1 , true );
129+ return NativeObject .objectFor ((Pointer ) result , ( Class <? extends NativeObject >) context .getTargetType (), 1 , true );
130130 }
131131 if (context instanceof StructureReadContext ) {
132132 StructureReadContext sctx = (StructureReadContext ) context ;
133133 boolean ownsHandle = sctx .getField ().getAnnotation (ConstField .class ) == null ;
134- return NativeObject .objectFor ((Pointer ) result , context .getTargetType (), 1 , ownsHandle );
134+ return NativeObject .objectFor ((Pointer ) result , ( Class <? extends NativeObject >) context .getTargetType (), 1 , ownsHandle );
135135 }
136136 throw new IllegalStateException ("Cannot convert to NativeObject from " + context );
137137 }
@@ -144,7 +144,7 @@ public Class<?> nativeType() {
144144
145145 @ SuppressWarnings (value = "unchecked" )
146146 public Object fromNative (Object value , FromNativeContext context ) {
147- return EnumMapper .getInstance ().valueOf ((Integer ) value , context .getTargetType ());
147+ return EnumMapper .getInstance ().valueOf ((Integer ) value , ( Class <? extends Enum >) context .getTargetType ());
148148 }
149149
150150 public Class <?> nativeType () {
0 commit comments