@@ -22,7 +22,6 @@ import '../../source/source_field_builder.dart';
2222import '../../source/source_loader.dart' ;
2323import '../../source/source_member_builder.dart' ;
2424import '../../source/source_method_builder.dart' ;
25- import '../../source/source_procedure_builder.dart' ;
2625import '../../source/source_property_builder.dart' ;
2726import '../hierarchy/hierarchy_builder.dart' ;
2827import 'identifiers.dart' ;
@@ -128,9 +127,7 @@ class MacroIntrospection {
128127
129128 /// Creates the [macro.Declaration] corresponding to [memberBuilder] .
130129 macro .Declaration _createMemberDeclaration (MemberBuilder memberBuilder) {
131- if (memberBuilder is SourceProcedureBuilder ) {
132- return _createFunctionDeclaration (memberBuilder);
133- } else if (memberBuilder is SourceMethodBuilder ) {
130+ if (memberBuilder is SourceMethodBuilder ) {
134131 return _createMethodDeclaration (memberBuilder);
135132 } else if (memberBuilder is SourcePropertyBuilder ) {
136133 return _createGetterDeclaration (memberBuilder);
@@ -499,78 +496,6 @@ class MacroIntrospection {
499496 return declaration;
500497 }
501498
502- /// Creates the [macro.FunctionDeclaration] corresponding to [builder] .
503- macro .FunctionDeclaration _createFunctionDeclaration (
504- SourceProcedureBuilder builder) {
505- var (
506- List <macro.FormalParameterDeclarationImpl > positionalParameters,
507- List <macro.FormalParameterDeclarationImpl > namedParameters
508- ) = _createParameters (builder.libraryBuilder, builder.formals);
509-
510- macro .ParameterizedTypeDeclaration ? definingTypeDeclaration = null ;
511- Builder ? parent = builder.parent;
512- if (parent is ClassBuilder ) {
513- definingTypeDeclaration = getClassDeclaration (parent);
514- } else if (parent is ExtensionTypeDeclarationBuilder ) {
515- definingTypeDeclaration = getExtensionTypeDeclaration (parent);
516- }
517- final macro .LibraryImpl library = getLibrary (builder.libraryBuilder);
518- macro .FunctionDeclaration declaration;
519- if (definingTypeDeclaration != null ) {
520- // TODO(johnniwinther): Should static fields be field or variable
521- // declarations?
522- declaration = new macro .MethodDeclarationImpl (
523- id: macro .RemoteInstance .uniqueId,
524- identifier: new MemberBuilderIdentifier (
525- memberBuilder: builder,
526- id: macro .RemoteInstance .uniqueId,
527- name: builder.name),
528- library: library,
529- // TODO(johnniwinther): Provide metadata annotations.
530- metadata: const [],
531- definingType:
532- definingTypeDeclaration.identifier as macro .IdentifierImpl ,
533- // TODO(johnniwinther): Real implementation of hasBody.
534- hasBody: true ,
535- hasExternal: builder.isExternal,
536- isGetter: builder.isGetter,
537- isOperator: builder.isOperator,
538- isSetter: builder.isSetter,
539- hasStatic: builder.isStatic,
540- positionalParameters: positionalParameters,
541- namedParameters: namedParameters,
542- returnType: types.getTypeAnnotation (
543- builder.libraryBuilder, builder.returnType),
544- // TODO(johnniwinther): Support typeParameters
545- typeParameters: const []);
546- } else {
547- declaration = new macro .FunctionDeclarationImpl (
548- id: macro .RemoteInstance .uniqueId,
549- identifier: new MemberBuilderIdentifier (
550- memberBuilder: builder,
551- id: macro .RemoteInstance .uniqueId,
552- name: builder.name),
553- library: library,
554- // TODO(johnniwinther): Provide metadata annotations.
555- metadata: const [],
556- // TODO(johnniwinther): Real implementation of hasBody.
557- hasBody: true ,
558- hasExternal: builder.isExternal,
559- isGetter: builder.isGetter,
560- isOperator: builder.isOperator,
561- isSetter: builder.isSetter,
562- positionalParameters: positionalParameters,
563- namedParameters: namedParameters,
564- returnType: types.getTypeAnnotation (
565- builder.libraryBuilder, builder.returnType),
566- // TODO(johnniwinther): Support typeParameters
567- typeParameters: const []);
568- }
569- _declarationOffsets[declaration] =
570- new UriOffset (builder.fileUri, builder.fileOffset);
571- return declaration;
572- }
573-
574499 /// Creates the [macro.FunctionDeclaration] corresponding to [builder] .
575500 macro .FunctionDeclaration _createMethodDeclaration (
576501 SourceMethodBuilder builder) {
@@ -973,8 +898,7 @@ class _DeclarationPhaseIntrospector extends _TypePhaseIntrospector
973898 classBuilder.fullMemberIterator ();
974899 while (iterator.moveNext ()) {
975900 SourceMemberBuilder memberBuilder = iterator.current;
976- if (memberBuilder is SourceProcedureBuilder ||
977- memberBuilder is SourceMethodBuilder ||
901+ if (memberBuilder is SourceMethodBuilder ||
978902 memberBuilder is SourcePropertyBuilder ) {
979903 result.add (_introspection.getMemberDeclaration (memberBuilder)
980904 as macro .MethodDeclaration );
@@ -987,8 +911,7 @@ class _DeclarationPhaseIntrospector extends _TypePhaseIntrospector
987911 extensionTypeDeclarationBuilder.fullMemberIterator ();
988912 while (iterator.moveNext ()) {
989913 SourceMemberBuilder memberBuilder = iterator.current;
990- if (memberBuilder is SourceProcedureBuilder ||
991- memberBuilder is SourceMethodBuilder ||
914+ if (memberBuilder is SourceMethodBuilder ||
992915 memberBuilder is SourcePropertyBuilder ) {
993916 result.add (_introspection.getMemberDeclaration (memberBuilder)
994917 as macro .MethodDeclaration );
0 commit comments