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

Side by Side Diff: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 1053813002: Issue 23068. Constructors should have the same const/factory modifiers to match. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.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 engine.incremental_resolver_test; 5 library engine.incremental_resolver_test;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 class M<T> {} 298 class M<T> {}
299 class A {} 299 class A {}
300 class B<T extends A> = Object with M<T>; 300 class B<T extends A> = Object with M<T>;
301 ''', r''' 301 ''', r'''
302 class M<T> {} 302 class M<T> {}
303 class A {} 303 class A {}
304 class B<T> = Object with M<T>; 304 class B<T> = Object with M<T>;
305 '''); 305 ''');
306 } 306 }
307 307
308 void test_false_constructor_keywordConst_add() {
309 _assertDoesNotMatch(r'''
310 class A {
311 A();
312 }
313 ''', r'''
314 class A {
315 const A();
316 }
317 ''');
318 }
319
320 void test_false_constructor_keywordConst_remove() {
321 _assertDoesNotMatch(r'''
322 class A {
323 const A();
324 }
325 ''', r'''
326 class A {
327 A();
328 }
329 ''');
330 }
331
332 void test_false_constructor_keywordFactory_add() {
333 _assertDoesNotMatch(r'''
334 class A {
335 A();
336 A.foo() {
337 return new A();
338 }
339 }
340 ''', r'''
341 class A {
342 A();
343 factory A.foo() {
344 return new A();
345 }
346 }
347 ''');
348 }
349
350 void test_false_constructor_keywordFactory_remove() {
351 _assertDoesNotMatch(r'''
352 class A {
353 A();
354 factory A.foo() {
355 return new A();
356 }
357 }
358 ''', r'''
359 class A {
360 A();
361 A.foo() {
362 return new A();
363 }
364 }
365 ''');
366 }
367
308 void test_false_constructor_parameters_list_add() { 368 void test_false_constructor_parameters_list_add() {
309 _assertDoesNotMatch(r''' 369 _assertDoesNotMatch(r'''
310 class A { 370 class A {
311 A(); 371 A();
312 } 372 }
313 ''', r''' 373 ''', r'''
314 class A { 374 class A {
315 A(int p); 375 A(int p);
316 } 376 }
317 '''); 377 ''');
(...skipping 3698 matching lines...) Expand 10 before | Expand all | Expand 10 after
4016 return ResolutionContextBuilder.contextFor(node, listener).scope; 4076 return ResolutionContextBuilder.contextFor(node, listener).scope;
4017 } 4077 }
4018 } 4078 }
4019 4079
4020 class _Edit { 4080 class _Edit {
4021 final int offset; 4081 final int offset;
4022 final int length; 4082 final int length;
4023 final String replacement; 4083 final String replacement;
4024 _Edit(this.offset, this.length, this.replacement); 4084 _Edit(this.offset, this.length, this.replacement);
4025 } 4085 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698