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

Side by Side Diff: pkg/analysis_server/test/analysis/notification_implemented_test.dart

Issue 1488443002: Issue 25057. A static member cannot be implemented. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « pkg/analysis_server/lib/src/domains/analysis/implemented_dart.dart ('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
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.analysis.notification.implemented; 5 library test.analysis.notification.implemented;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 set f(_) {} // A 308 set f(_) {} // A
309 } 309 }
310 class B extends A { 310 class B extends A {
311 set f(_) {} // B 311 set f(_) {} // B
312 } 312 }
313 '''); 313 ''');
314 await prepareImplementedElements(); 314 await prepareImplementedElements();
315 assertHasImplementedMember('f(_) {} // A'); 315 assertHasImplementedMember('f(_) {} // A');
316 } 316 }
317 317
318 test_static_field_instanceStatic() async {
319 addTestFile('''
320 class A {
321 int F = 0;
322 }
323 class B extends A {
324 static int F = 1;
325 }
326 ''');
327 await prepareImplementedElements();
328 assertNoImplementedMember('F = 0');
329 }
330
331 test_static_field_staticInstance() async {
332 addTestFile('''
333 class A {
334 static int F = 0;
335 }
336 class B extends A {
337 int F = 1;
338 }
339 ''');
340 await prepareImplementedElements();
341 assertNoImplementedMember('F = 0');
342 }
343
344 test_static_field_staticStatic() async {
345 addTestFile('''
346 class A {
347 static int F = 0;
348 }
349 class B extends A {
350 static int F = 1;
351 }
352 ''');
353 await prepareImplementedElements();
354 assertNoImplementedMember('F = 0');
355 }
356
357 test_static_method_instanceStatic() async {
358 addTestFile('''
359 class A {
360 int m() => 0;
361 }
362 class B extends A {
363 static int m() => 1;
364 }
365 ''');
366 await prepareImplementedElements();
367 assertNoImplementedMember('m() => 0');
368 }
369
370 test_static_method_staticInstance() async {
371 addTestFile('''
372 class A {
373 static int m() => 0;
374 }
375 class B extends A {
376 int m() => 1;
377 }
378 ''');
379 await prepareImplementedElements();
380 assertNoImplementedMember('m() => 0');
381 }
382
383 test_static_method_staticStatic() async {
384 addTestFile('''
385 class A {
386 static int m() => 0;
387 }
388 class B extends A {
389 static int m() => 1;
390 }
391 ''');
392 await prepareImplementedElements();
393 assertNoImplementedMember('m() => 0');
394 }
395
318 Future waitForImplementedElements() { 396 Future waitForImplementedElements() {
319 Future waitForNotification(int times) { 397 Future waitForNotification(int times) {
320 if (times == 0 || implementedClasses != null) { 398 if (times == 0 || implementedClasses != null) {
321 return new Future.value(); 399 return new Future.value();
322 } 400 }
323 return new Future.delayed( 401 return new Future.delayed(
324 new Duration(milliseconds: 1), () => waitForNotification(times - 1)); 402 new Duration(milliseconds: 1), () => waitForNotification(times - 1));
325 } 403 }
326 return waitForNotification(30000); 404 return waitForNotification(30000);
327 } 405 }
328 } 406 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/domains/analysis/implemented_dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698