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

Unified Diff: dart/tests/language/src/ConstructorRedirectTest.dart

Issue 9663065: Fix ConstructorRedirectTest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add commetn Created 8 years, 9 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 | « dart/tests/language/language-leg.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/language/src/ConstructorRedirectTest.dart
diff --git a/dart/tests/language/src/ConstructorRedirectTest.dart b/dart/tests/language/src/ConstructorRedirectTest.dart
index 68603654f84566c3167e1e10fe31bf1237d25166..fe792747f4e0abc8ac6b1dcebb8c07b147a59560 100644
--- a/dart/tests/language/src/ConstructorRedirectTest.dart
+++ b/dart/tests/language/src/ConstructorRedirectTest.dart
@@ -9,6 +9,15 @@ class A {
A.named(x, int y) : this(x + y);
A.named2(int x, int y, z) : this.named(staticFun(x, y), z);
+ // The following is a bit tricky. It is a compile-time error to
+ // refer to this (implicitly or explicitly) from an initializer.
+ // When we remove the line with moreStaticFun, staticFun is really a
+ // static function and it is legal to call it. This is what will
+ // happen in the /none version of this test. However, in /01,
+ // staticFun isn't really a static function and should cause a
+ // compile-time error.
+ static
+ moreStaticFun() {} /// 01: compile-time error
int staticFun(int v1, int v2) {
return v1 * v2;
}
« no previous file with comments | « dart/tests/language/language-leg.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698