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

Side by Side Diff: dart/tests/language/src/ImplicitThisTest.dart

Issue 8438032: Test implicit this on fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/tests/language/language.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 interface Interface {
6 final x;
7 }
8
9 class Abstract implements Interface {
kasperl 2011/11/02 09:03:00 Maybe add a comment here. Something like: If you s
10 String toString() => x.toString();
11 }
12
13 class Concrete extends Abstract {
14 get x() => 7;
15 }
16
17 class SubConcrete extends Abstract {
kasperl 2011/11/02 09:03:00 How about ConcreteA and ConcreteB? They are not re
ahe 2011/11/02 19:03:57 But they are, I just subclassed the wrong class. G
18 final x;
19 SubConcrete(this.x);
20 }
21
22 void main() {
23 var x = new Abstract(); /// 01: static type error
24 Expect.equals(x, x);
25 Expect.equals(new Concrete().toString(), '7');
kasperl 2011/11/02 09:03:00 expected, actual
26 Expect.equals(new SubConcrete(42).toString(), '42');
27 Expect.equals(new SubConcrete(new Concrete()).toString(), '7');
28 }
OLDNEW
« no previous file with comments | « dart/tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698