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

Side by Side Diff: tests/compiler/dart2js/semantic_visitor_test_decl_data.dart

Issue 1417103002: Add ElementKind for factory constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 part of dart2js.semantics_visitor_test; 5 part of dart2js.semantics_visitor_test;
6 6
7 const Map<String, List<Test>> DECL_TESTS = const { 7 const Map<String, List<Test>> DECL_TESTS = const {
8 'Function declarations': const [ 8 'Function declarations': const [
9 const Test( 9 const Test(
10 ''' 10 '''
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 ], 529 ],
530 method: ''), 530 method: ''),
531 const Test.clazz( 531 const Test.clazz(
532 ''' 532 '''
533 class C { 533 class C {
534 factory C(a, b) => null; 534 factory C(a, b) => null;
535 } 535 }
536 ''', 536 ''',
537 const [ 537 const [
538 const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL, 538 const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL,
539 element: 'function(C#)', 539 element: 'factory_constructor(C#)',
540 parameters: '(a,b)', 540 parameters: '(a,b)',
541 body: '=>null;'), 541 body: '=>null;'),
542 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 542 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
543 element: 'parameter(#a)', 543 element: 'parameter(#a)',
544 index: 0), 544 index: 0),
545 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 545 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
546 element: 'parameter(#b)', 546 element: 'parameter(#b)',
547 index: 1), 547 index: 1),
548 ], 548 ],
549 method: ''), 549 method: ''),
550 const Test.clazz( 550 const Test.clazz(
551 ''' 551 '''
552 class C { 552 class C {
553 factory C(a, b) = C._; 553 factory C(a, b) = C._;
554 C._(a, b); 554 C._(a, b);
555 } 555 }
556 ''', 556 ''',
557 const [ 557 const [
558 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, 558 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
559 element: 'function(C#)', 559 element: 'factory_constructor(C#)',
560 parameters: '(a,b)', 560 parameters: '(a,b)',
561 target: 'generative_constructor(C#_)', 561 target: 'generative_constructor(C#_)',
562 type: 'C'), 562 type: 'C'),
563 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 563 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
564 element: 'parameter(#a)', 564 element: 'parameter(#a)',
565 index: 0), 565 index: 0),
566 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 566 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
567 element: 'parameter(#b)', 567 element: 'parameter(#b)',
568 index: 1), 568 index: 1),
569 ], 569 ],
570 method: ''), 570 method: ''),
571 const Test.clazz( 571 const Test.clazz(
572 ''' 572 '''
573 class C { 573 class C {
574 factory C(a, b) = D; 574 factory C(a, b) = D;
575 } 575 }
576 class D<T> { 576 class D<T> {
577 D(a, b); 577 D(a, b);
578 } 578 }
579 ''', 579 ''',
580 const [ 580 const [
581 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, 581 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
582 element: 'function(C#)', 582 element: 'factory_constructor(C#)',
583 parameters: '(a,b)', 583 parameters: '(a,b)',
584 target: 'generative_constructor(D#)', 584 target: 'generative_constructor(D#)',
585 type: 'D'), 585 type: 'D'),
586 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 586 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
587 element: 'parameter(#a)', 587 element: 'parameter(#a)',
588 index: 0), 588 index: 0),
589 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 589 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
590 element: 'parameter(#b)', 590 element: 'parameter(#b)',
591 index: 1), 591 index: 1),
592 ], 592 ],
593 method: ''), 593 method: ''),
594 const Test.clazz( 594 const Test.clazz(
595 ''' 595 '''
596 class C { 596 class C {
597 factory C(a, b) = D<int>; 597 factory C(a, b) = D<int>;
598 } 598 }
599 class D<T> { 599 class D<T> {
600 D(a, b); 600 D(a, b);
601 } 601 }
602 ''', 602 ''',
603 const [ 603 const [
604 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, 604 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
605 element: 'function(C#)', 605 element: 'factory_constructor(C#)',
606 parameters: '(a,b)', 606 parameters: '(a,b)',
607 target: 'generative_constructor(D#)', 607 target: 'generative_constructor(D#)',
608 type: 'D<int>'), 608 type: 'D<int>'),
609 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 609 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
610 element: 'parameter(#a)', 610 element: 'parameter(#a)',
611 index: 0), 611 index: 0),
612 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 612 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
613 element: 'parameter(#b)', 613 element: 'parameter(#b)',
614 index: 1), 614 index: 1),
615 ], 615 ],
616 method: ''), 616 method: ''),
617 const Test.clazz( 617 const Test.clazz(
618 ''' 618 '''
619 class C { 619 class C {
620 factory C(a, b) = D<int>; 620 factory C(a, b) = D<int>;
621 } 621 }
622 class D<T> { 622 class D<T> {
623 factory D(a, b) = E<D<T>>; 623 factory D(a, b) = E<D<T>>;
624 } 624 }
625 class E<S> { 625 class E<S> {
626 E(a, b); 626 E(a, b);
627 } 627 }
628 ''', 628 ''',
629 const [ 629 const [
630 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, 630 const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
631 element: 'function(C#)', 631 element: 'factory_constructor(C#)',
632 parameters: '(a,b)', 632 parameters: '(a,b)',
633 target: 'function(D#)', 633 target: 'factory_constructor(D#)',
634 type: 'D<int>'), 634 type: 'D<int>'),
635 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 635 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
636 element: 'parameter(#a)', 636 element: 'parameter(#a)',
637 index: 0), 637 index: 0),
638 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, 638 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
639 element: 'parameter(#b)', 639 element: 'parameter(#b)',
640 index: 1), 640 index: 1),
641 ], 641 ],
642 method: ''), 642 method: ''),
643 ], 643 ],
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 ''' 861 '''
862 const m = 42; 862 const m = 42;
863 ''', 863 ''',
864 const [ 864 const [
865 const Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL, 865 const Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL,
866 element: 'field(m)', 866 element: 'field(m)',
867 constant: 42), 867 constant: 42),
868 ]), 868 ]),
869 ], 869 ],
870 }; 870 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698