View | Details | Raw Unified | Return to bug 196200 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java (-1 / +9 lines)
Lines 97-102 Link Here
97
					switch (this.resolvedType.problemId()) {
97
					switch (this.resolvedType.problemId()) {
98
						case ProblemReasons.NotFound :
98
						case ProblemReasons.NotFound :
99
						case ProblemReasons.NotVisible :
99
						case ProblemReasons.NotVisible :
100
						case ProblemReasons.InheritedNameHidesEnclosingName :
100
							TypeBinding type = this.resolvedType.closestMatch();
101
							TypeBinding type = this.resolvedType.closestMatch();
101
							return type;			
102
							return type;			
102
						default :
103
						default :
Lines 121-127 Link Here
121
						typeArgument.resolveType((BlockScope) scope, checkBounds);
122
						typeArgument.resolveType((BlockScope) scope, checkBounds);
122
					}
123
					}
123
				}
124
				}
124
				return null;
125
				switch (this.resolvedType.problemId()) {
126
					case ProblemReasons.NotFound :
127
					case ProblemReasons.NotVisible :
128
					case ProblemReasons.InheritedNameHidesEnclosingName :
129
						return this.resolvedType.closestMatch();
130
					default :
131
						return null;
132
				}
125
			}
133
			}
126
			enclosingType = this.resolvedType.enclosingType(); // if member type
134
			enclosingType = this.resolvedType.enclosingType(); // if member type
127
			if (enclosingType != null && (enclosingType.isGenericType() || enclosingType.isParameterizedType())) {
135
			if (enclosingType != null && (enclosingType.isGenericType() || enclosingType.isParameterizedType())) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java (+1 lines)
Lines 121-126 Link Here
121
						switch (this.resolvedType.problemId()) {
121
						switch (this.resolvedType.problemId()) {
122
							case ProblemReasons.NotFound :
122
							case ProblemReasons.NotFound :
123
							case ProblemReasons.NotVisible :
123
							case ProblemReasons.NotVisible :
124
							case ProblemReasons.InheritedNameHidesEnclosingName :
124
								TypeBinding type = this.resolvedType.closestMatch();
125
								TypeBinding type = this.resolvedType.closestMatch();
125
								return type;			
126
								return type;			
126
							default :
127
							default :
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java (+38 lines)
Lines 3286-3289 Link Here
3286
			"Zork cannot be resolved to a type\n" + 
3286
			"Zork cannot be resolved to a type\n" + 
3287
			"----------\n");
3287
			"----------\n");
3288
}
3288
}
3289
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation
3290
public void test073() {
3291
	this.runNegativeTest(
3292
			new String[] {
3293
				"X.java", //-----------------------------------------------------------------------
3294
				"public class X {\n" + 
3295
				"	/**\n" + 
3296
				"	 * @see Foo.Private#foo()\n" + 
3297
				"	 * @param p\n" + 
3298
				"	 */\n" + 
3299
				"	void foo(Foo.Private p) {\n" + 
3300
				"		p.foo();\n" + 
3301
				"	}\n" + 
3302
				"}\n" + 
3303
				"\n" + 
3304
				"class Foo {\n" + 
3305
				"	private class Private {\n" + 
3306
				"		private void foo(){}\n" + 
3307
				"	}\n" + 
3308
				"}\n"
3309
			},
3310
			"----------\n" + 
3311
			"1. ERROR in X.java (at line 6)\n" + 
3312
			"	void foo(Foo.Private p) {\n" + 
3313
			"	         ^^^^^^^^^^^\n" + 
3314
			"The type Foo.Private is not visible\n" + 
3315
			"----------\n" + 
3316
			"2. ERROR in X.java (at line 7)\n" + 
3317
			"	p.foo();\n" + 
3318
			"	^\n" + 
3319
			"The type Foo.Private is not visible\n" + 
3320
			"----------\n" + 
3321
			"3. WARNING in X.java (at line 13)\n" + 
3322
			"	private void foo(){}\n" + 
3323
			"	             ^^^^^\n" + 
3324
			"The method foo() from the type Foo.Private is never used locally\n" + 
3325
			"----------\n");
3326
}
3289
}
3327
}

Return to bug 196200