codespecs / daikon-dot-net-front-end

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

Incorrect return value type for method returning generic type with bounded type parameter #108

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The method QuickGraph.DelegateBidirectionalIncidenceGraph`2:

public IEnumerable<TEdge> InEdges(TVertex v)
{
   IEnumerable<TEdge> result;
   if (!this.tryGetInEdges(v, out result))
      return Enumerable.Empty<TEdge>();
   return result;
}

has the following DECL:

 variable return
    var-kind return
    dec-type QuickGraph.IEdge`1[TVertex]
    rep-type hashcode
    comparability 2
    parent QuickGraph.IBidirectionalIncidenceGraph`2.InEdges(TVertex\_v):::EXIT 2

, where the return type is incorrect. A side effect is that there are 
sub-expressions generated for the return value (e.g., return.Source) that don't 
make sense.

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

GoogleCodeExporter commented 9 years ago

Original comment by Todd.Sch...@gmail.com on 14 Jun 2013 at 12:59

GoogleCodeExporter commented 9 years ago
The return type has bound where TEdge : IEdge<TVertex>, IEquatable<TEdge>

The return type is:

System.Collections.Generic.IEnumerable`1[[{QuickGraph.IEdge`1, QuickGraph, 
Version=3.6.61114.0, Culture=neutral, 
PublicKeyToken=f3fb40175eec2af3|System.IEquatable`1, mscorlib, Version=2.0.5.0, 
Culture=neutral, PublicKeyToken=7cec85d7bea7798e}]], mscorlib, Version=2.0.5.0, 
Culture=neutral, PublicKeyToken=7cec85d7bea7798e

GetAllTypes returns two types: IEdge`1, IEquatable`1, which results in the 
incorrect types being output

Original comment by Todd.Sch...@gmail.com on 14 Jun 2013 at 1:36

GoogleCodeExporter commented 9 years ago

Original comment by Todd.Sch...@gmail.com on 14 Jun 2013 at 1:40

GoogleCodeExporter commented 9 years ago
Made a quick fix in 4b760d264f21; traces will be missing some information since 
generics are dropped in the case of generic types with bounded parameters, and 
only a single type is taken for simple bounded types.

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