changeset 744:e23ed3e167e8

Futher improvements to compiler diagnostics. The compiler now emits detailed information about SAM conversion failures occurring in argument position.
author mcimadamore
date Thu, 21 Oct 2010 15:06:09 +0100
parents f813d93e510c
children 4506d2ab97a0
files src/share/classes/com/sun/tools/javac/code/Types.java src/share/classes/com/sun/tools/javac/comp/Attr.java src/share/classes/com/sun/tools/javac/comp/Check.java src/share/classes/com/sun/tools/javac/comp/Infer.java src/share/classes/com/sun/tools/javac/comp/Lower.java src/share/classes/com/sun/tools/javac/comp/Resolve.java src/share/classes/com/sun/tools/javac/comp/TransTypes.java src/share/classes/com/sun/tools/javac/resources/compiler.properties test/tools/javac/6840059/T6840059.out test/tools/javac/Diagnostics/6722234/T6722234a_1.out test/tools/javac/Diagnostics/6722234/T6722234a_2.out test/tools/javac/Diagnostics/6722234/T6722234b_1.out test/tools/javac/Diagnostics/6722234/T6722234b_2.out test/tools/javac/Diagnostics/6722234/T6722234c.out test/tools/javac/Diagnostics/6799605/T6799605.out test/tools/javac/Diagnostics/6862608/T6862608b.out test/tools/javac/diags/examples.not-yet.txt test/tools/javac/lambda/BadTargetType.out test/tools/javac/lambda/LambdaConv02.out
diffstat 19 files changed, 232 insertions(+), 206 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Oct 21 15:06:09 2010 +0100
@@ -299,92 +299,40 @@
     }
 
     //where
-    private ConversionResult isConvertible(Type t, final Type s, Warner warn) {
+    private ConversionResult isConvertible(final Type t, final Type s, final Warner warn) {
         if (isFunctionType(t) &&
-                (isFunctionType(s) || s.tsym.kind == Kinds.TYP)) {
-            final SAMResult samRes = findSAM(s);
-            if (!isFunctionType(s) && samRes.isErroneous()) {
-                return new ConversionResult(samRes.errKey,
-                        samRes.getTargetName(),
-                        Kinds.kindName(s.tsym),
-                        s.tsym);
-            }
-            Type mtype = isFunctionType(s) ?
-                s.asMethodType(this) :
-                samRes.getTargetType();
-            //the order is inmportant here because of type-inference
-            //(reference types first)
-            final boolean isReturnOk = t.getReturnType().tag == NONE || (t.getReturnType() == syms.voidType ?
-                (isSameType(mtype.getReturnType(), boxedClass(syms.voidType).type) ||
-                    isSameType(mtype.getReturnType(), syms.voidType)) :
-                (isConvertibleNoCheck(t.getReturnType(), mtype.getReturnType(), warn) ||
-                containsType(mtype.getReturnType(), boxedTypeOrType(t.getReturnType()))));
-
-            boolean argsOk = t.getParameterTypes().size() == mtype.getParameterTypes().size() && (
-                isSameTypes(mtype.getParameterTypes(), t.getParameterTypes()) ||
-                containsType(mtype.getParameterTypes(), t.getParameterTypes()));
-
-            boolean thrownOk = t.getThrownTypes() == Type.noTypes ||
-                    chk.unhandled(t.getThrownTypes(), mtype.getThrownTypes()).isEmpty();
-            return new ConversionResult(isReturnOk && argsOk && thrownOk) {
+                (s.tsym.kind == Kinds.TYP)) {
+            return new ConversionResult(true) {
                 @Override
                 public boolean check(Env<AttrContext> env) {
-                    if (!isSuccess()) {
-                        //target method is not compatible
-                        setDiagnostic("incompatible.target.in.lambda.conv");
+                    final SAMResult samRes = findSAM(s, env);
+                    if (samRes.isErroneous()) {
+                        setKey(samRes.errKey).setArgs(samRes.args);
                         return false;
                     }
-                    else if (s.isInterface() ||
-                            isFunctionType(s))
-                        return true;
-                    else {
-                        //SAM type is an abstract class - check that both
-                        //the target method and the SAM constructor are accessible
-                        //in the given context
-                        Type site = env.enclClass.type;
-                        Symbol noArgConstr = findNoArgConstructor((ClassSymbol)s.tsym);
-                        ListBuffer<Symbol> buf = lb();
-                        findSAM(s, buf, s.isInterface());
-                        boolean isTargetAccessible = false;
-                        for (Symbol target : buf) {
-                            if (isAccessible(target, site)) {
-                                isTargetAccessible = true;
-                                break;
-                            }
-                        }
-                        if (!isAccessible(noArgConstr, site)) {
-                            setDiagnostic("target.for.lambda.conv.must.have.default.constr");
-                            return false;
-                        }
-                        if (s.getEnclosingType() != Type.noType &&
-                                (Resolve.isStatic(env) ||
-                                !isSubtypeUnchecked(site, s.getEnclosingType()))) {
-                            setDiagnostic("encl.instance.for.lambda.conv.target.must.be.in.scope",
-                                    s.getEnclosingType());
-                            return false;
-                        }
-                        if (!isTargetAccessible) {
-                            setDiagnostic("target.not.accessible");
-                            return false;
-                        }
-                        return true;
+                    Type mtype = samRes.getTargetType();
+                    //the order is important here because of type-inference
+                    //(reference types first)
+                    boolean isReturnOk = t.getReturnType().tag == NONE || (t.getReturnType() == syms.voidType ?
+                        (isSameType(mtype.getReturnType(), boxedClass(syms.voidType).type) ||
+                            isSameType(mtype.getReturnType(), syms.voidType)) :
+                        (isConvertibleNoCheck(t.getReturnType(), mtype.getReturnType(), warn) ||
+                        containsType(mtype.getReturnType(), boxedTypeOrType(t.getReturnType()))));
+
+                    boolean argsOk = t.getParameterTypes().size() == mtype.getParameterTypes().size() && (
+                        isSameTypes(mtype.getParameterTypes(), t.getParameterTypes()) ||
+                        containsType(mtype.getParameterTypes(), t.getParameterTypes()));
+
+                    boolean thrownOk = t.getThrownTypes() == Type.noTypes ||
+                            chk.unhandled(t.getThrownTypes(), mtype.getThrownTypes()).isEmpty();
+                    if (!isReturnOk || !argsOk || !thrownOk) {
+                        //target method is not compatible
+                        setKey("incompatible.target.in.lambda.conv").setArgs(samRes.getTargetName(),
+                                Kinds.kindName(s.tsym),
+                                s.tsym);
+                        return false;
                     }
-                }
-                private void setDiagnostic(String key, Object... args) {
-                    Object[] args2 = new Object[args.length + 3];
-                    args2[0] = samRes.getTargetName();
-                    args2[1] = Kinds.kindName(s.tsym);
-                    args2[2] = s.tsym;
-                    int pos = 3;
-                    for (Object o : args) {
-                        args2[pos] = o;
-                    }
-                    setKey(key).setArgs(args2);
-                }
-                private boolean isAccessible(Symbol sym, Type site) {
-                    return (sym.flags() & (PUBLIC | PROTECTED)) != 0 ||
-                            (sym.packge() == site.tsym.packge() &&
-                            (sym.flags() & PRIVATE) == 0);
+                    return true;
                 }
             };
         }
@@ -464,26 +412,40 @@
      * @param t the type in which the target method is to be searched
      * @return a SAMResult instance
      */
-    public SAMResult findSAM(Type t) {
+    public SAMResult findSAM(Type t, Env<AttrContext> env) {
+        Type site = env.enclClass.type;
         if (t.tsym.kind != Kinds.TYP || (t.tsym.flags() & ABSTRACT) == 0) {
             //t must be an abstract class or an interface
-            return new SAMResult(t, "target.for.lambda.conv.must.be.abstract");
-        } else if (!t.isInterface() &&
-                    findNoArgConstructor((ClassSymbol)t.tsym) == null) {
-            //if t is an abstract class, then it should have a default constructor
-            return new SAMResult(t, "target.for.lambda.conv.must.have.default.constr");
+            return new SAMResult(site, t, "target.for.lambda.conv.must.be.abstract");
+        }
+        
+        if (!t.isInterface()) {
+            Symbol noArgConstr = findNoArgConstructor((ClassSymbol)t.tsym);
+            if (noArgConstr == null) {
+                //if t is an abstract class, then it should have a default constructor
+                return new SAMResult(site, t, "target.for.lambda.conv.must.have.default.constr");
+            } else if (!isAccessible(noArgConstr, site)) {
+                return new SAMResult(site, t, "target.for.lambda.conv.must.have.default.constr");
+            }
+        }
+
+        if (t.getEnclosingType() != Type.noType &&
+                (Resolve.isStatic(env) ||
+                !isSubtypeUnchecked(site, t.getEnclosingType()))) {
+            return new SAMResult(site, t, "encl.instance.for.lambda.conv.target.must.be.in.scope",
+                    t.getEnclosingType());
+        }
+        
+        ListBuffer<Symbol> abstracts = ListBuffer.lb();
+        int count = findSAM(t, abstracts, t.isInterface());
+        if (abstracts.size() == 0) {
+            //t must define a suitable non-generic method
+            return new SAMResult(site, t, "no.target.method.for.lambda.conv");
+        } else if (abstracts.size() != count) {
+            //the target method(s) should be the only abstract members of t
+            return new SAMResult(site, t, "multiple.targets.for.lambda.conv");
         } else {
-            ListBuffer<Symbol> abstracts = ListBuffer.lb();
-            int count = findSAM(t, abstracts, t.isInterface());
-            if (abstracts.size() == 0) {
-                //t must define a suitable non-generic method
-                return new SAMResult(t, "no.target.method.for.lambda.conv");
-            } else if (abstracts.size() != count) {
-                //the target method(s) should be the only abstract members of t
-                return new SAMResult(t, "multiple.targets.for.lambda.conv");
-            } else {
-                return new SAMResult(t, abstracts.toList());
-            }
+            return new SAMResult(site, t, abstracts.toList());
         }
     }    
     //where
@@ -530,6 +492,12 @@
         return null;
     }
 
+    private boolean isAccessible(Symbol sym, Type site) {
+        return (sym.flags() & (PUBLIC | PROTECTED)) != 0 ||
+                (sym.packge() == site.tsym.packge() &&
+                (sym.flags() & PRIVATE) == 0);
+    }
+
     /**
      * This class is used to store the result of a SAM lookup. Usually a lookup
      * ends up in finding a list of suitable, override-equivalent method symbols.
@@ -545,21 +513,24 @@
         Type targetType;
         List<Symbol> methodSyms;
         String errKey;
-
-        public SAMResult(Type samType, String errKey) {
-           this(samType, List.<Symbol>nil(), errKey);
+        Object[] args;
+        Type site;
+
+        public SAMResult(Type site, Type samType, String errKey, Object... args) {
+           this(site, samType, List.<Symbol>nil(), errKey);
            targetType = syms.errType;
+           setDiagnostic(errKey, args);
         }
 
-        public SAMResult(Type samType, List<Symbol> methodSyms) {
-            this(samType, methodSyms, null);
-            targetType = getTargetType();
+        public SAMResult(Type site, Type samType, List<Symbol> methodSyms) {
+            this(site, samType, methodSyms, null);
         }
 
-        private SAMResult(Type samType, List<Symbol> methodSyms, String errKey) {
+        private SAMResult(Type site, Type samType, List<Symbol> methodSyms, String errKey, Object... args) {
+            this.site = site;
             this.samType = samType;
             this.methodSyms = methodSyms;
-            this.errKey = errKey;
+            setDiagnostic(errKey, args);
         }
 
         /**
@@ -612,7 +583,10 @@
             } else {
                 if (methodSyms.size() == 1) {
                     if (methodSyms.head.type.tag == FORALL) {
-                        errKey = "invalid.generic.target.for.lambda.conv";
+                        setDiagnostic("invalid.generic.target.for.lambda.conv");
+                        return syms.errType;
+                    } else if (!isAccessible(methodSyms.head, site)) {
+                        setDiagnostic("target.not.accessible");
                         return syms.errType;
                     } else {
                         return memberType(samType, methodSyms.head);
@@ -626,7 +600,10 @@
                             memberType(samType, methodSyms.head).getParameterTypes();
                     for (Symbol msym : methodSyms) {
                         if (msym.type.tag == FORALL) {
-                            errKey = "invalid.generic.target.for.lambda.conv";
+                            setDiagnostic("invalid.generic.target.for.lambda.conv");
+                            return syms.errType;
+                        } else if (!isAccessible(methodSyms.head, site)) {
+                            setDiagnostic("target.not.accessible");
                             return syms.errType;
                         }
                         Type mtype = memberType(samType, msym);
@@ -639,7 +616,7 @@
                                     glb(resType, mtype.getReturnType());
 
                         if (resType.isErroneous()) {
-                            errKey = "incompatible.targets.in.lambda.conv";
+                            setDiagnostic("incompatible.targets.in.lambda.conv");
                             return syms.errType;
                         }
                         thrownTypes = chk.union(mtype.getThrownTypes(), thrownTypes);
@@ -654,9 +631,7 @@
 
         public JCDiagnostic getDiagnostic(JCDiagnostic.Factory diags) {
             return diags.fragment(errKey,
-                        getTargetName(),
-                        Kinds.kindName(samType.tsym),
-                        samType.tsym);
+                        args);
         }
 
         /**
@@ -665,7 +640,20 @@
          * @return true if an error occurred during the SAM lookup.
          */
         public boolean isErroneous() {
-            return targetType.isErroneous();
+            return getTargetType().isErroneous();
+        }
+
+        private void setDiagnostic(String key, Object... args) {
+            Object[] args2 = new Object[args.length + 3];
+            args2[0] = getTargetName();
+            args2[1] = Kinds.kindName(samType.tsym);
+            args2[2] = samType.tsym;
+            int pos = 3;
+            for (Object o : args) {
+                args2[pos] = o;
+            }
+            errKey = key;
+            this.args = args2;
         }
     }
     // </editor-fold>
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Oct 21 15:06:09 2010 +0100
@@ -1768,7 +1768,7 @@
                         identifyLambdaCandidate &&
                         clazztype.tag == CLASS &&
                         lambdaOrReferenceAllowed(tree) &&
-                        !types.findSAM(clazztype).isErroneous()) {
+                        !types.findSAM(clazztype, env).isErroneous()) {
                     log.note(tree.def, "potential.lambda.found");
                 }
 
@@ -2086,7 +2086,7 @@
         Type lambdaType = null;
 
         if (!types.isFunctionType(targetType)) {
-            Types.SAMResult samMethod = types.findSAM(targetType);
+            Types.SAMResult samMethod = types.findSAM(targetType, env);
             lambdaName = samMethod.getTargetName();
             lambdaFlags = samMethod.getTargetFlags();
             lambdaType = samMethod.getTargetType();
@@ -2118,6 +2118,13 @@
         }
         
         Type typeToCheck = lambdaOrReferenceTargetType(that);
+        if (typeToCheck.tag != NONE) {
+            Type samType = chk.checkSAM(that, typeToCheck, env);
+            if (samType.isErroneous()) {
+                result = that.type = samType;
+                return;
+            }
+        }
 
         //if the lambda expression needs parameter inference and/or the target
         //type is unknown (e.g. the lambda position is in argument position)
@@ -2349,21 +2356,10 @@
         //'normalize' the target type (i.e. strip toplevel wildcards, where possible)
         Type superType = types.normalize(samOrFunctionType);
 
-        if (superType.isErroneous() ||
-                superType == Type.noType ||
-                (!types.isFunctionType(samOrFunctionType) &&
-                types.findSAM(superType).isErroneous())) {
-            //if the target type is neither a SAM type nor a function type, reports an error
-            Types.SAMResult res = types.findSAM(superType);
-            String key = "invalid.target.type.for.lambda.conv";
-            JCDiagnostic explanation = null;
-            if (res.isErroneous()) {
-                key = "invalid.target.type.for.lambda.conv.1";
-                explanation = res.getDiagnostic(diags);
-            }
-            log.error(that.pos(), key, samOrFunctionType, explanation);
-            return that.type = syms.errType;
-        }
+//        Type samType = chk.checkSAM(that, superType, env);
+//        if (samType.isErroneous()) {
+//            return that.type = samType;
+//        }
 
         //create an environment for attribution of the lambda expression
         final Env<AttrContext> localEnv = lambdaEnvironment(that, superType);
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Oct 21 15:06:09 2010 +0100
@@ -466,7 +466,7 @@
                 }
             } catch (Infer.InvalidInstanceException ex) {
                 JCDiagnostic d = ex.getDiagnostic();
-                log.error(pos, "invalid.inferred.types", ex.tvars, d);
+                log.error(pos, "invalid.inferred.types", d);
                 return types.createErrorType(pt);
             }
         }
@@ -788,6 +788,24 @@
         }
     }
 
+    Type checkSAM(DiagnosticPosition pos, Type t, Env<AttrContext> env) {
+        if (t.tag == CLASS &&
+                types.findSAM(t, env).isErroneous()) {
+            //if the target type is neither a SAM type nor a function type, reports an error
+            Types.SAMResult res = types.findSAM(t, env);
+            String key = "invalid.target.type.for.lambda.conv";
+            JCDiagnostic explanation = null;
+            if (res.isErroneous()) {
+                key = "invalid.target.type.for.lambda.conv.1";
+                explanation = res.getDiagnostic(diags);
+            }
+            log.error(pos, key, t, explanation);
+            return types.createErrorType(t);
+        } else {
+            return t;
+        }
+    }
+
     void checkVarargMethodDecl(JCMethodDecl tree) {
         MethodSymbol m = tree.sym;
         //check the element type of the vararg
--- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Oct 21 15:06:09 2010 +0100
@@ -85,28 +85,9 @@
     public static class InferenceException extends Resolve.InapplicableMethodException {
         private static final long serialVersionUID = 0;
 
-        public List<Type> tvars;
-
         InferenceException(JCDiagnostic.Factory diags) {
             super(diags);
         }
-
-        public InferenceException setTvars(List<Type> tvars) {
-            this.tvars = tvars;
-            return this;
-        }
-        @Override
-        InferenceException setMessage(String key) {
-            super.setMessage(key);
-            tvars = null;
-            return this;
-        }
-        @Override
-        InferenceException setMessage(String key, Object... args) {
-            super.setMessage(key, args);
-            tvars = null;
-            return this;
-        }
     }
 
     public static class NoInstanceException extends InferenceException {
@@ -237,7 +218,7 @@
             that.inst.isErroneous())
             throw ambiguousNoInstanceException
                 .setMessage("no.unique.maximal.instance.exists",
-                            that.qtype, that.hibounds).setTvars(List.<Type>of(that.qtype));
+                            that.qtype, that.hibounds);
     }
     //where
         private boolean isSubClass(Type t, final List<Type> ts) {
@@ -277,7 +258,7 @@
             if (that.inst == null || that.inst.tag == ERROR)
                     throw ambiguousNoInstanceException
                         .setMessage("no.unique.minimal.instance.exists",
-                                    that.qtype, that.lobounds).setTvars(List.<Type>of(that.qtype));
+                                    that.qtype, that.lobounds);
             // VGJ: sort of inlined maximizeInst() below.  Adding
             // bounds can cause lobounds that are above hibounds.
             if (that.hibounds.isEmpty())
@@ -329,19 +310,13 @@
             types.boxedClass(to).type :
             to; //this is a hack
         Type qtype1 = types.subst(that.qtype, that.tvars, undetvars);
-        boolean ok = true;
-        if (types.isFunctionType(qtype1)) {
-            if (types.isFunctionType(to2) ||
-                    !types.findSAM(to2).isErroneous()) {
-                ok = types.isConvertible(env, qtype1, to2);
-            }
-        } else {
-            ok = types.isSubtype(qtype1, to2);
-        }
-        if (!ok) {
+        boolean works = types.isFunctionType(qtype1) && to2.tag == CLASS ?
+            types.isConvertible(env, qtype1, to2, warn) :
+            types.isSubtype(qtype1, to2);
+        if (!works) {
             throw unambiguousNoInstanceException
                 .setMessage("infer.no.conforming.instance.exists",
-                            that.tvars, that.qtype, to).setTvars(that.tvars);
+                            that.tvars, that.qtype, to);
         }
         for (List<Type> l = undetvars; l.nonEmpty(); l = l.tail)
             maximizeInst((UndetVar) l.head, warn);
@@ -423,19 +398,31 @@
                     capturedArgs.append(actual = types.capture(actual));
                 }
 
-                boolean works = allowBoxing
-                    ? types.isConvertible(env, actual, undetFormal, warn)
-                    : types.isSubtypeUnchecked(actual, undetFormal, warn);
+                boolean works = false;
+                JCDiagnostic problem = null;
+                if (allowBoxing) {
+                    Types.ConversionResult res = types.isAssignable(actual, undetFormal, warn);
+                    works = res.check(env);
+                    problem = res.getDiagnostic(diags);
+                } else {
+                    works = types.isSubtypeUnchecked(actual, undetFormal, warn);
+                }
                 if (!works) {
                     if (tvars.nonEmpty()) {
+                        String errKey = problem == null ?
+                            "infer.no.conforming.assignment.exists" :
+                            "infer.no.conforming.assignment.exists.1";
                         throw unambiguousNoInstanceException
-                            .setMessage("infer.no.conforming.assignment.exists",
-                                        tvars, actualNoCapture, formal).setTvars(tvars);
+                            .setMessage(errKey,
+                                        tvars, actualNoCapture, formal, problem);
                     }
                     else {
+                        String errKey = problem == null ?
+                            "no.conforming.assignment.exists" :
+                            "no.conforming.assignment.exists.1";
                         throw unambiguousNoInstanceException
-                            .setMessage("no.conforming.assignment.exists",
-                                        actualNoCapture, formal);
+                            .setMessage(errKey,
+                                        actualNoCapture, formal, problem);
                     }
                 }
                 formals = formals.tail;
@@ -465,16 +452,24 @@
                     } else {
                         capturedArgs.append(actual = types.capture(actual));
                     }
-                    boolean works = types.isConvertible(env, actual, elemUndet, warn);
+                    Types.ConversionResult res = types.isAssignable(actual, elemUndet, warn);
+                    boolean works = res.check(env);
+                    JCDiagnostic problem = res.getDiagnostic(diags);
                     if (!works) {
                         if (tvars.nonEmpty()) {
+                            String errKey = problem == null ?
+                                "infer.no.conforming.assignment.exists" :
+                                "infer.no.conforming.assignment.exists.1";
                             throw unambiguousNoInstanceException
-                                .setMessage("infer.no.conforming.assignment.exists",
-                                            tvars, actualNoCapture, elemType).setTvars(tvars);
+                                .setMessage(errKey,
+                                            tvars, actualNoCapture, elemType);
                         }
                         else {
+                            String errKey = problem == null ?
+                                "no.conforming.assignment.exists" :
+                                "no.conforming.assignment.exists.1";
                             throw unambiguousNoInstanceException
-                            .setMessage("no.conforming.assignment.exists",
+                                .setMessage(errKey,
                                         actualNoCapture, elemType);
                         }
                     }
@@ -552,7 +547,7 @@
                     if (!rs.argumentsAcceptable(env, capturedArgs2, formals,
                            allowBoxing, useVarargs, warn)) {
                       // inferred method is not applicable
-                      throw invalidInstanceException.setMessage("inferred.do.not.conform.to.params", formals, argtypes).setTvars(tvars);
+                      throw invalidInstanceException.setMessage("inferred.do.not.conform.to.params", formals, argtypes);
                     }
                     // check that inferred bounds conform to their bounds
                     checkWithinBounds(all_tvars,
@@ -569,7 +564,7 @@
         }
         else if (!rs.argumentsAcceptable(env, capturedArgs.toList(), types.subst(mt.getParameterTypes(), tvars, insttypes.toList()), allowBoxing, useVarargs, warn)) {
             // inferred method is not applicable
-            throw invalidInstanceException.setMessage("inferred.do.not.conform.to.params", mt.getParameterTypes(), argtypes).setTvars(tvars);
+            throw invalidInstanceException.setMessage("inferred.do.not.conform.to.params", mt.getParameterTypes(), argtypes);
         }
         else {
             // return instantiated version of method type
@@ -641,7 +636,7 @@
             if (!types.isSubtypeUnchecked(args.head, bounds, warn))
                 throw invalidInstanceException
                     .setMessage("inferred.do.not.conform.to.bounds",
-                                args.head, bounds).setTvars(List.of(tvs.head));
+                                args.head, bounds);
         }
     }
 
--- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Oct 21 15:06:09 2010 +0100
@@ -3097,7 +3097,7 @@
     @SuppressWarnings("unchecked") // XXX unchecked
     <T extends JCTree> T unlambdaIfNeeded(T tree, Type type) {
         if (types.isSameType(tree.type, syms.methodHandleType) &&
-                !types.findSAM(type).isErroneous()) {
+                !types.findSAM(type, attrEnv).isErroneous()) {
             return (T)(type.isInterface() ?
                 lambdaToInterface((JCExpression)tree, type) :
                 lambdaToClass((JCExpression)tree, type));
@@ -3127,7 +3127,7 @@
         boolean isStatic = outerThisStack.isEmpty();
 
         ListBuffer<Symbol> samMethods = ListBuffer.lb();
-        Types.SAMResult samRes = types.findSAM(type);        
+        Types.SAMResult samRes = types.findSAM(type, attrEnv);
         Type targetMethodType = samRes.getTargetType();
 
         //assign translated method handle to final variable $mh
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Oct 21 15:06:09 2010 +0100
@@ -443,13 +443,23 @@
             Type actual = argtypes.head.tag == FORALL ?
                 infer.instantiateArg(env, (ForAll)argtypes.head, formals.head, warn) :
                 argtypes.head;
-            boolean works = allowBoxing
-                ? types.isConvertible(env, actual, formals.head, warn)
-                : types.isSubtypeUnchecked(actual, formals.head, warn);
-            if (!works)
-                throw inapplicableMethodException.setMessage("no.conforming.assignment.exists",
+            boolean works = false;
+            JCDiagnostic problem = null;
+            if (allowBoxing) {
+                Types.ConversionResult res = types.isAssignable(actual, formals.head, warn);
+                works = res.check(env);
+                problem = res.getDiagnostic(diags);
+            } else {
+                works = types.isSubtypeUnchecked(actual, formals.head, warn);
+            }
+            if (!works) {
+                String errKey = problem == null ?
+                    "no.conforming.assignment.exists" :
+                    "no.conforming.assignment.exists.1";
+                throw inapplicableMethodException.setMessage(errKey,
                         actual,
-                        formals.head);
+                        formals.head, problem);
+            }
             argtypes = argtypes.tail;
             formals = formals.tail;
         }
@@ -463,10 +473,17 @@
     	        Type actual = argtypes.head.tag == FORALL ?
     	            infer.instantiateArg(env, (ForAll)argtypes.head, elt, warn) :
                     argtypes.head;
-    	        if (!types.isConvertible(env, actual, elt, warn))
-    	            throw inapplicableMethodException.setMessage("varargs.argument.mismatch",
+                Types.ConversionResult res = types.isAssignable(actual, elt, warn);
+    	        if (!res.check(env)) {
+                    JCDiagnostic problem = res.getDiagnostic(diags);
+                    String errKey = problem == null ?
+                        "varargs.argument.mismatch" :
+                        "varargs.argument.mismatch.1";
+    	            throw inapplicableMethodException.setMessage(errKey,
                             actual,
-                            elt);
+                            elt,
+                            problem);
+                }
     	        argtypes = argtypes.tail;
     	    }
         }
--- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Oct 21 15:06:09 2010 +0100
@@ -123,10 +123,6 @@
      *  @param target  The target type.
      */
     JCExpression coerce(JCExpression tree, Type target) {
-        if (types.isSameType(tree.type, syms.methodHandleType) &&
-                types.findSAM(target) != null) {
-            return tree;
-        }
         Type btarget = target.baseType();
         if (tree.type.isPrimitive() == target.isPrimitive()) {
             return types.isAssignableNoCheck(tree.type, btarget, Warner.noWarnings)
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Oct 20 18:19:47 2010 +0100
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Oct 21 15:06:09 2010 +0100
@@ -555,7 +555,7 @@
 compiler.err.undetermined.type.1=\
     type parameters of {0} cannot be determined; {1}
 compiler.err.invalid.inferred.types=\
-    invalid inferred types for {0}; {1}
+    invalid inferred types; {0}
 compiler.err.cant.apply.diamond=\
     cannot infer type arguments for {0}
 compiler.err.cant.apply.diamond.1=\
@@ -1150,8 +1150,14 @@
     no unique minimal instance exists for type variable {0} with lower bounds {1}
 compiler.misc.infer.no.conforming.instance.exists=\
     no instance(s) of type variable(s) {0} exist so that {1} conforms to {2}
+compiler.misc.infer.no.conforming.instance.exists.1=\
+    no instance(s) of type variable(s) {0} exist so that {1} conforms to {2}\n\
+    ({3})
 compiler.misc.infer.no.conforming.assignment.exists=\
     no instance(s) of type variable(s) {0} exist so that argument type {1} conforms to formal parameter type {2}
+compiler.misc.infer.no.conforming.assignment.exists.1=\
+    no instance(s) of type variable(s) {0} exist so that argument type {1} conforms to formal parameter type {2}\n\
+    ({3})
 compiler.misc.infer.arg.length.mismatch=\
     cannot instantiate from arguments because actual and formal argument lists differ in length
 compiler.misc.inferred.do.not.conform.to.bounds=\
@@ -1176,8 +1182,14 @@
     actual and formal argument lists differ in length
 compiler.misc.no.conforming.assignment.exists=\
     actual argument {0} cannot be converted to {1} by method invocation conversion
+compiler.misc.no.conforming.assignment.exists.1=\
+    actual argument {0} cannot be converted to {1} by method invocation conversion\n\
+    ({2})
 compiler.misc.varargs.argument.mismatch=\
     argument type {0} does not conform to vararg element type {1}
+compiler.misc.varargs.argument.mismatch.1=\
+    argument type {0} does not conform to vararg element type {1}\n\
+    ({2})
 #####
 
 ## The first argument ({0}) is a "kindname".
--- a/test/tools/javac/6840059/T6840059.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/6840059/T6840059.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,3 +1,3 @@
-T6840059.java:15:9: compiler.err.cant.apply.symbol.1: kindname.constructor, T6840059, java.lang.Integer, java.lang.String, kindname.class, T6840059, (compiler.misc.no.conforming.assignment.exists: java.lang.String, java.lang.Integer)
+T6840059.java:15:9: compiler.err.cant.apply.symbol.1: kindname.constructor, T6840059, java.lang.Integer, java.lang.String, kindname.class, T6840059, (compiler.misc.no.conforming.assignment.exists: java.lang.String, java.lang.Integer, null)
 T6840059.java:15:25: compiler.err.cant.apply.symbol.1: kindname.constructor, T6840059, java.lang.Integer, compiler.misc.no.args, kindname.class, T6840059, (compiler.misc.arg.length.mismatch)
 2 errors
--- a/test/tools/javac/Diagnostics/6722234/T6722234a_1.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/Diagnostics/6722234/T6722234a_1.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,2 +1,2 @@
-T6722234a.java:12:9: compiler.err.cant.apply.symbol.1: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, (compiler.misc.no.conforming.assignment.exists: compiler.misc.type.var: T, 2, compiler.misc.type.var: T, 1)
+T6722234a.java:12:9: compiler.err.cant.apply.symbol.1: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, (compiler.misc.no.conforming.assignment.exists: compiler.misc.type.var: T, 2, compiler.misc.type.var: T, 1, null)
 1 error
--- a/test/tools/javac/Diagnostics/6722234/T6722234a_2.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/Diagnostics/6722234/T6722234a_2.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,3 +1,3 @@
-T6722234a.java:12:9: compiler.err.cant.apply.symbol.1: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, (compiler.misc.no.conforming.assignment.exists: compiler.misc.type.var: T, 2, compiler.misc.type.var: T, 1)
+T6722234a.java:12:9: compiler.err.cant.apply.symbol.1: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, (compiler.misc.no.conforming.assignment.exists: compiler.misc.type.var: T, 2, compiler.misc.type.var: T, 1, null)
 - compiler.misc.where.description.typevar.1: compiler.misc.type.var: T, 1,compiler.misc.type.var: T, 2,{(compiler.misc.where.typevar: compiler.misc.type.var: T, 1, java.lang.String, kindname.class, T6722234a),(compiler.misc.where.typevar: compiler.misc.type.var: T, 2, java.lang.Integer, kindname.method, <compiler.misc.type.var: T, 2>test(compiler.misc.type.var: T, 2))}
 1 error
--- a/test/tools/javac/Diagnostics/6722234/T6722234b_1.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/Diagnostics/6722234/T6722234b_1.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,2 +1,2 @@
-T6722234b.java:16:9: compiler.err.cant.apply.symbol.1: kindname.method, m, List<T>,List<T>, List<compiler.misc.type.captureof: 1, ? extends T6722234b>,List<compiler.misc.type.captureof: 2, ? extends T6722234b>, kindname.class, T6722234b, (compiler.misc.infer.no.conforming.assignment.exists: T, List<compiler.misc.type.captureof: 2, ? extends T6722234b>, List<T>)
+T6722234b.java:16:9: compiler.err.cant.apply.symbol.1: kindname.method, m, List<T>,List<T>, List<compiler.misc.type.captureof: 1, ? extends T6722234b>,List<compiler.misc.type.captureof: 2, ? extends T6722234b>, kindname.class, T6722234b, (compiler.misc.infer.no.conforming.assignment.exists: T, List<compiler.misc.type.captureof: 2, ? extends T6722234b>, List<T>, null)
 1 error
--- a/test/tools/javac/Diagnostics/6722234/T6722234b_2.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/Diagnostics/6722234/T6722234b_2.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,4 +1,4 @@
-T6722234b.java:16:9: compiler.err.cant.apply.symbol.1: kindname.method, m, List<T>,List<T>, List<compiler.misc.captured.type: 1>,List<compiler.misc.captured.type: 2>, kindname.class, T6722234b, (compiler.misc.infer.no.conforming.assignment.exists: T, List<compiler.misc.captured.type: 2>, List<T>)
+T6722234b.java:16:9: compiler.err.cant.apply.symbol.1: kindname.method, m, List<T>,List<T>, List<compiler.misc.captured.type: 1>,List<compiler.misc.captured.type: 2>, kindname.class, T6722234b, (compiler.misc.infer.no.conforming.assignment.exists: T, List<compiler.misc.captured.type: 2>, List<T>, null)
 - compiler.misc.where.description.typevar: T,{(compiler.misc.where.typevar: T, Object, kindname.method, <T>m(List<T>,List<T>))}
 - compiler.misc.where.description.captured.1: compiler.misc.captured.type: 1,compiler.misc.captured.type: 2,{(compiler.misc.where.captured.1: compiler.misc.captured.type: 1, T6722234b, compiler.misc.type.null, ? extends T6722234b),(compiler.misc.where.captured.1: compiler.misc.captured.type: 2, T6722234b, compiler.misc.type.null, ? extends T6722234b)}
 1 error
--- a/test/tools/javac/Diagnostics/6722234/T6722234c.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/Diagnostics/6722234/T6722234c.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,2 +1,2 @@
-T6722234c.java:14:9: compiler.err.cant.apply.symbol.1: kindname.method, m, T6722234c.String, java.lang.String, kindname.class, T6722234c, (compiler.misc.infer.no.conforming.assignment.exists: T, java.lang.String, T6722234c.String)
+T6722234c.java:14:9: compiler.err.cant.apply.symbol.1: kindname.method, m, T6722234c.String, java.lang.String, kindname.class, T6722234c, (compiler.misc.infer.no.conforming.assignment.exists: T, java.lang.String, T6722234c.String, null)
 1 error
--- a/test/tools/javac/Diagnostics/6799605/T6799605.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/Diagnostics/6799605/T6799605.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,4 +1,4 @@
 T6799605.java:17:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.inferred.do.not.conform.to.bounds: compiler.misc.type.captureof: 1, ?, T6799605<compiler.misc.type.captureof: 1, ?>))}
-T6799605.java:18:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.no.conforming.assignment.exists: T, T6799605<compiler.misc.type.captureof: 2, ?>, T6799605<T>)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch))}
-T6799605.java:19:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.no.conforming.assignment.exists: T, T6799605<compiler.misc.type.captureof: 2, ?>, T6799605<T>)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch))}
+T6799605.java:18:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.no.conforming.assignment.exists: T, T6799605<compiler.misc.type.captureof: 2, ?>, T6799605<T>, null)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch))}
+T6799605.java:19:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.no.conforming.assignment.exists: T, T6799605<compiler.misc.type.captureof: 2, ?>, T6799605<T>, null)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch))}
 3 errors
--- a/test/tools/javac/Diagnostics/6862608/T6862608b.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/Diagnostics/6862608/T6862608b.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,3 +1,3 @@
-T6862608b.java:11:7: compiler.err.cant.apply.symbol.1: kindname.method, test, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T66862608b<compiler.misc.type.var: T, 1,compiler.misc.type.var: S, 2>, (compiler.misc.no.conforming.assignment.exists: compiler.misc.type.var: T, 2, compiler.misc.type.var: T, 1)
+T6862608b.java:11:7: compiler.err.cant.apply.symbol.1: kindname.method, test, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T66862608b<compiler.misc.type.var: T, 1,compiler.misc.type.var: S, 2>, (compiler.misc.no.conforming.assignment.exists: compiler.misc.type.var: T, 2, compiler.misc.type.var: T, 1, null)
 - compiler.misc.where.description.typevar.1: compiler.misc.type.var: T, 1,compiler.misc.type.var: T, 2,compiler.misc.type.var: S, 1,compiler.misc.type.var: S, 2,{(compiler.misc.where.typevar: compiler.misc.type.var: T, 1, java.lang.String, kindname.class, T66862608b),(compiler.misc.where.typevar: compiler.misc.type.var: T, 2, compiler.misc.type.var: S, 1, kindname.method, <compiler.misc.type.var: S, 1,compiler.misc.type.var: T, 2>foo(compiler.misc.type.var: T, 2)),(compiler.misc.where.typevar: compiler.misc.type.var: S, 1, java.lang.Object, kindname.method, <compiler.misc.type.var: S, 1,compiler.misc.type.var: T, 2>foo(compiler.misc.type.var: T, 2)),(compiler.misc.where.typevar: compiler.misc.type.var: S, 2, java.lang.Object, kindname.class, T66862608b)}
 1 error
--- a/test/tools/javac/diags/examples.not-yet.txt	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/diags/examples.not-yet.txt	Thu Oct 21 15:06:09 2010 +0100
@@ -149,7 +149,11 @@
 compiler.misc.where.description.disjunctive.1                                    #LAMBDA
 compiler.misc.where.disjunctive                                                  #LAMBDA
 compiler.misc.where.disjunctive.1                                                #LAMBDA
+compiler.misc.infer.no.conforming.assignment.exists.1                            #LAMBDA
+compiler.misc.infer.no.conforming.instance.exists.1                              #LAMBDA
+compiler.misc.no.conforming.assignment.exists.1                                  #LAMBDA
+compiler.misc.varargs.argument.mismatch.1                                        #LAMBDA
+compiler.misc.type.lambda                                                        #LAMBDA
 compiler.note.potential.lambda.found                                             #LAMBDA
-compiler.misc.type.lambda                                                        #LAMBDA
 compiler.warn.cyclic.lambda.inference.throws                                     #LAMBDA
 compiler.warn.cyclic.lambda.inference.throws.1                                   #LAMBDA
--- a/test/tools/javac/lambda/BadTargetType.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/lambda/BadTargetType.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,5 +1,5 @@
 BadTargetType.java:37:24: compiler.err.invalid.target.type.for.lambda.conv.1: java.lang.Object, (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, java.lang.Object)
 BadTargetType.java:38:17: compiler.err.invalid.target.type.for.lambda.conv.1: java.lang.Object, (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, java.lang.Object)
-BadTargetType.java:41:9: compiler.err.cant.apply.symbol.1: kindname.method, m1, java.lang.Object, #void(int), kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists: #void(int), java.lang.Object)
-BadTargetType.java:42:9: compiler.err.cant.apply.symbol.1: kindname.method, m2, java.lang.Object, #void(int), kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists: #void(int), java.lang.Object)
+BadTargetType.java:41:9: compiler.err.cant.apply.symbol.1: kindname.method, m1, java.lang.Object, #void(int), kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists.1: #void(int), java.lang.Object, (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, java.lang.Object))
+BadTargetType.java:42:9: compiler.err.cant.apply.symbol.1: kindname.method, m2, java.lang.Object, #void(int), kindname.class, BadTargetType, (compiler.misc.no.conforming.assignment.exists.1: #void(int), java.lang.Object, (compiler.misc.target.for.lambda.conv.must.be.abstract: null, kindname.class, java.lang.Object))
 4 errors
--- a/test/tools/javac/lambda/LambdaConv02.out	Wed Oct 20 18:19:47 2010 +0100
+++ b/test/tools/javac/lambda/LambdaConv02.out	Thu Oct 21 15:06:09 2010 +0100
@@ -1,3 +1,3 @@
-LambdaConv02.java:42:18: compiler.err.prob.found.req: (compiler.misc.incompatible.types.1: (compiler.misc.encl.instance.for.lambda.conv.target.must.be.in.scope: m, kindname.class, LambdaConv02.SAM, LambdaConv02)), #void(), LambdaConv02.SAM
-LambdaConv02.java:43:9: compiler.err.cant.apply.symbol.1: kindname.method, test1, LambdaConv02.SAM, #void(), kindname.class, LambdaConv02, (compiler.misc.no.conforming.assignment.exists: #void(), LambdaConv02.SAM)
+LambdaConv02.java:42:18: compiler.err.invalid.target.type.for.lambda.conv.1: LambdaConv02.SAM, (compiler.misc.encl.instance.for.lambda.conv.target.must.be.in.scope: null, kindname.class, LambdaConv02.SAM, LambdaConv02)
+LambdaConv02.java:43:9: compiler.err.cant.apply.symbol.1: kindname.method, test1, LambdaConv02.SAM, #void(), kindname.class, LambdaConv02, (compiler.misc.no.conforming.assignment.exists.1: #void(), LambdaConv02.SAM, (compiler.misc.encl.instance.for.lambda.conv.target.must.be.in.scope: null, kindname.class, LambdaConv02.SAM, LambdaConv02))
 2 errors