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

Side by Side Diff: tests/language/method_override4_test.dart

Issue 18600007: Relax method override restrictions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test and status updates. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 import 'package:expect/expect.dart';
6
7 class A {
8 foo(required1, { named1: 499}) => -(required1 + named1 * 3);
9 bar(required1, required2, { named1: 13, named2: 17})
10 => -(required1 + required2 * 3 + named1 * 5 + named2 * 7);
11 gee({named1: 31}) => -named1;
12 }
13
14 class B extends A {
15 foo(required1) => required1;
16 bar(required1, required2, { named1: 29 })
17 => required1 + required2 * 3 + named1 * 5;
18 gee({named2: 11}) => named2 * 99;
19 }
20
21 main() {
22 var b = new B();
23 Expect.throws(() => b.foo(499, named1: 88), (e) => e is NoSuchMethodError);
24 Expect.throws(() => b.bar(1, 2, named1: 3, named2: 88),
25 (e) => e is NoSuchMethodError);
26 Expect.throws(() => b.bar(1, 2, named2: 88),
27 (e) => e is NoSuchMethodError);
28 Expect.throws(() => b.gee(named1: 3),
29 (e) => e is NoSuchMethodError);
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698