Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 10885040: Issue 4778. Fix for resolving type of unqualifed field access (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 8f497e6ef2c26896b737806ea1ad6d7446eb23de..8d33f64c50d93187e52d586d03912938e2b38368 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -4196,6 +4196,29 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(ResolverErrorCode.REDIRECTION_CONSTRUCTOR_TARGET_MUST_BE_CONST, 7, 29, 5));
}
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=4778
+ */
+ public void test_unqualifiedAccessToGenericTypeField() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class Game {}",
+ "class GameRenderer<G extends Game> {",
+ " G get game => null;",
+ "}",
+ "class SpaceShooterGame extends Game {",
+ " int score;",
+ "}",
+ "class SpaceShooterRenderer extends GameRenderer<SpaceShooterGame> {",
+ " someMethod() {",
+ " var a = game.score;",
+ " }",
+ "}",
+ ""));
+ assertErrors(libraryResult.getErrors());
+ }
+
private <T extends DartNode> T findNode(final Class<T> clazz, String pattern) {
final int index = testSource.indexOf(pattern);
assertTrue(index != -1);
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698