codespecs / daikon-dot-net-front-end

Celeriac .NET Front-End for Daikon
Other
9 stars 1 forks source link

Bad links from expressions to interface methods when implementation uses subtype of generic parameter #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the following example below, Celeriac attempts to link the properties of the 
SReversedEdge parameter to the parameter of in the corresponding interface. 
However, SReversedEdge, as a subclass of IEdge, has more properties / methods.

public interface IEdgeSet<TVertex, TEdge>
  where TEdge : IEdge<TVertex>{

  bool ContainsEdge(TEdge edge);
}

public sealed class ReversedBidirectionalGraph<TVertex, TEdge> : 
  IBidirectionalGraph<TVertex,SReversedEdge<TVertex,TEdge>>
  where TEdge : IEdge<TVertex>

  public bool ContainsEdge(SReversedEdge<TVertex, TEdge> edge)
  {
     ...
  }
}

Original issue reported on code.google.com by Todd.Sch...@gmail.com on 14 Jun 2013 at 3:46

GoogleCodeExporter commented 9 years ago
Add a conservative fix in 79894216e4b0; basically parameters and return values 
are only linked if they refer to the same type (so generic parameters / return 
values won't be linked in most cases).

Original comment by Todd.Sch...@gmail.com on 14 Jun 2013 at 4:43