forked from jasder/antlr
Fix generics for IParseTreeVisitor
This commit is contained in:
parent
efe28ed6fc
commit
253bedd0ee
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace Antlr4.Runtime.Tree
|
|||
/// <see cref="IParseTreeVisitor{Result}">IParseTreeVisitor<Result></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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue