Fix generics for IParseTreeVisitor

This commit is contained in:
Sam Harwell 2013-02-16 15:12:24 -06:00
parent efe28ed6fc
commit 253bedd0ee
4 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ namespace Antlr4.Runtime.Tree
{
}
public override T Accept<T, _T1>(IParseTreeVisitor<_T1> visitor)
public override T Accept<T>(IParseTreeVisitor<T> visitor)
{
return visitor.VisitErrorNode(this);
}

View File

@ -62,7 +62,7 @@ namespace Antlr4.Runtime.Tree
/// <see cref="IParseTreeVisitor{Result}">IParseTreeVisitor&lt;Result&gt;</see>
/// needs a double dispatch method.
/// </summary>
T Accept<T, _T1>(IParseTreeVisitor<_T1> visitor) where _T1:T;
T Accept<T>(IParseTreeVisitor<T> visitor);
/// <summary>Return the combined text of all leaf nodes.</summary>
/// <remarks>

View File

@ -44,7 +44,7 @@ namespace Antlr4.Runtime.Tree
/// </remarks>
/// <author>Sam Harwell</author>
/// <?></?>
public interface IParseTreeVisitor<Result>
public interface IParseTreeVisitor<out Result>
{
/// <summary>Visit a parse tree, and return a user-defined result of the operation.</summary>
/// <remarks>Visit a parse tree, and return a user-defined result of the operation.</remarks>

View File

@ -95,7 +95,7 @@ namespace Antlr4.Runtime.Tree
}
}
public virtual T Accept<T, _T1>(IParseTreeVisitor<_T1> visitor) where _T1:T
public virtual T Accept<T>(IParseTreeVisitor<T> visitor)
{
return visitor.VisitTerminal(this);
}