protected internal GenericMethodDecl(Parser parser, CodeObject parent, bool typeParametersAlreadyParsed, ParseFlags flags)
     : base(parser, parent, false, flags)
 {
     if (typeParametersAlreadyParsed)
     {
         // The type parameters were already parsed on the unused Dot expression - fetch them from there
         UnresolvedRef unresolvedRef = (UnresolvedRef)((Dot)parser.LastUnusedCodeObject).Right;
         _typeParameters = new ChildList <TypeParameter>(this);
         foreach (Expression expression in unresolvedRef.TypeArguments)
         {
             _typeParameters.Add(new TypeParameter(expression is UnresolvedRef ? ((UnresolvedRef)expression).Name : null));
         }
         unresolvedRef.TypeArguments = null;
     }
     ParseMethodNameAndType(parser, parent, true, false);
     ParseModifiersAndAnnotations(parser);  // Parse any attributes and/or modifiers
     if (!typeParametersAlreadyParsed)
     {
         _typeParameters = TypeParameter.ParseList(parser, this);  // Parse any type parameters
     }
     ParseParameters(parser);
     _constraintClauses = ConstraintClause.ParseList(parser, this);  // Parse any constraint clauses
     ParseTerminatorOrBody(parser, flags);
 }
Ejemplo n.º 2
0
 protected void ParseConstraintClauses(Parser parser)
 {
     _constraintClauses = ConstraintClause.ParseList(parser, this);  // Parse any constraint clauses
 }