-Xlint:all Bug

John Rose john.r.rose at oracle.com
Mon Aug 9 15:57:18 PDT 2010


On Aug 6, 2010, at 9:32 PM, Howard Lovatt wrote:

> There is a minor bug when you use -Xlint:all, I get:
> 
> Compiling 1 source file to /Users/lov080/Dropbox/Personal/Java/examples/Invoke Dynamic Multiple Dispatch/build/classes
> /Users/lov080/Dropbox/Personal/Java/examples/Invoke Dynamic Multiple Dispatch/src/invokedynamicmultipledispatch/Cost.java:61: warning: [rawtypes] found raw type: Class
>         cost += InvokeDynamic.<@BootstrapMethod( value = Cost.class, name = "bootstrapDynamic" ) double>cost( price, item );
>   missing type parameters for generic class Class<T>
>   where T is a type-variable:
>     T extends Object declared in class Class
> 
>   -- Howard.
> 
> PS Is this the right place to report MLVM bugs?

This is a good place to report MLVM bugs.

Also, I suggest moving the @BootstrapMethod annotation to an enclosing class or method.  We are probably going to get rid of the explicit return type occurrences ('double' in your case) and this means the annotation has to float up to the method or class level.

(To put different BSMs on successive indy sites, factor them into different methods, or spin the bytecodes directly.)

Here is a "heads up" about the type arguments:  The explicit return types will be replaced by a target-typing rule.  This will reduce the impact of 292 on the language and also create a clearer notation.  Our source codes will have to change from expressions like InvokeDynamic.<T>foo() to (T) InvokeDynamic.foo(), and likewise for method handle invokes.

The cast will be optional (like the type argument) if T is Object.  The call will have to be an ExpressionStatement and only if T is void (since no cast is possible).  To take a non-void return and throw it away, use a temporary variable (as the JLS suggests).

We'll support both forms for a little while.  Watch for warnings on the type argument!

-- John


More information about the mlvm-dev mailing list