OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.kernel_library_builder; | 5 library fasta.kernel_library_builder; |
6 | 6 |
7 import 'package:front_end/src/scanner/token.dart' show Token; | 7 import 'package:front_end/src/scanner/token.dart' show Token; |
8 | 8 |
9 import 'package:kernel/ast.dart'; | 9 import 'package:kernel/ast.dart'; |
10 | 10 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 void addFactoryMethod( | 553 void addFactoryMethod( |
554 List<MetadataBuilder> metadata, | 554 List<MetadataBuilder> metadata, |
555 int modifiers, | 555 int modifiers, |
556 ConstructorReferenceBuilder constructorNameReference, | 556 ConstructorReferenceBuilder constructorNameReference, |
557 List<FormalParameterBuilder> formals, | 557 List<FormalParameterBuilder> formals, |
558 ConstructorReferenceBuilder redirectionTarget, | 558 ConstructorReferenceBuilder redirectionTarget, |
559 int charOffset, | 559 int charOffset, |
560 int charOpenParenOffset, | 560 int charOpenParenOffset, |
561 int charEndOffset, | 561 int charEndOffset, |
562 String nativeMethodName) { | 562 String nativeMethodName) { |
| 563 KernelTypeBuilder returnType = addNamedType( |
| 564 currentDeclaration.parent.name, <KernelTypeBuilder>[], charOffset); |
563 // Nested declaration began in `OutlineBuilder.beginFactoryMethod`. | 565 // Nested declaration began in `OutlineBuilder.beginFactoryMethod`. |
564 DeclarationBuilder<KernelTypeBuilder> factoryDeclaration = | 566 DeclarationBuilder<KernelTypeBuilder> factoryDeclaration = |
565 endNestedDeclaration(); | 567 endNestedDeclaration(); |
566 String name = constructorNameReference.name; | 568 String name = constructorNameReference.name; |
567 String constructorName = | 569 String constructorName = |
568 computeAndValidateConstructorName(name, charOffset); | 570 computeAndValidateConstructorName(name, charOffset); |
569 if (constructorName != null) { | 571 if (constructorName != null) { |
570 name = constructorName; | 572 name = constructorName; |
571 } | 573 } |
572 assert(constructorNameReference.suffix == null); | 574 assert(constructorNameReference.suffix == null); |
573 KernelProcedureBuilder procedure = new KernelProcedureBuilder( | 575 KernelProcedureBuilder procedure = new KernelProcedureBuilder( |
574 metadata, | 576 metadata, |
575 staticMask | modifiers, | 577 staticMask | modifiers, |
576 null, | 578 returnType, |
577 name, | 579 name, |
578 <TypeVariableBuilder>[], | 580 <TypeVariableBuilder>[], |
579 formals, | 581 formals, |
580 ProcedureKind.Factory, | 582 ProcedureKind.Factory, |
581 this, | 583 this, |
582 charOffset, | 584 charOffset, |
583 charOpenParenOffset, | 585 charOpenParenOffset, |
584 charEndOffset, | 586 charEndOffset, |
585 nativeMethodName, | 587 nativeMethodName, |
586 redirectionTarget); | 588 redirectionTarget); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 mixinApplicationClasses.putIfAbsent(name, () => builder); | 847 mixinApplicationClasses.putIfAbsent(name, () => builder); |
846 if (existing != builder) { | 848 if (existing != builder) { |
847 part.scope.local.remove(name); | 849 part.scope.local.remove(name); |
848 } | 850 } |
849 }); | 851 }); |
850 super.includePart(part); | 852 super.includePart(part); |
851 nativeMethods.addAll(part.nativeMethods); | 853 nativeMethods.addAll(part.nativeMethods); |
852 boundlessTypeVariables.addAll(part.boundlessTypeVariables); | 854 boundlessTypeVariables.addAll(part.boundlessTypeVariables); |
853 } | 855 } |
854 } | 856 } |
OLD | NEW |