Index: QualifiedNameReference.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java,v retrieving revision 1.65 diff -u -r1.65 QualifiedNameReference.java --- QualifiedNameReference.java 22 Sep 2004 10:55:00 -0000 1.65 +++ QualifiedNameReference.java 20 Oct 2004 21:07:29 -0000 @@ -265,23 +265,25 @@ if (runtimeTimeType == null || compileTimeType == null) return; // set the generic cast after the fact, once the type expectation is fully known (no need for strict cast) - FieldBinding field = null; - int length = this.otherBindings == null ? 0 : this.otherBindings.length; - if (length == 0) { - if (this.binding != null && this.binding.isValidBinding()) { - field = (FieldBinding) this.binding; - } - } else { - field = this.otherBindings[length-1]; - } - if (field != null) { - FieldBinding originalBinding = field.original(); - if (originalBinding != field) { - // extra cast needed if method return type has type variable - if ((originalBinding.type.tagBits & TagBits.HasTypeVariable) != 0 && runtimeTimeType.id != T_Object) { - setGenericCast(length,originalBinding.type.genericCast(runtimeTimeType)); - } - } + if ((bits & FIELD) != 0) { + FieldBinding field = null; + int length = this.otherBindings == null ? 0 : this.otherBindings.length; + if (length == 0) { + if (this.binding != null && this.binding.isValidBinding()) { + field = (FieldBinding) this.binding; + } + } else { + field = this.otherBindings[length-1]; + } + if (field != null) { + FieldBinding originalBinding = field.original(); + if (originalBinding != field) { + // extra cast needed if method return type has type variable + if ((originalBinding.type.tagBits & TagBits.HasTypeVariable) != 0 && runtimeTimeType.id != T_Object) { + setGenericCast(length,originalBinding.type.genericCast(runtimeTimeType)); + } + } + } } super.computeConversion(scope, runtimeTimeType, compileTimeType); }