Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Mar 4, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 14 Jun 2013 at 12:54

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 14 Jun 2013 at 12:59

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 14 Jun 2013 at 1:36

  • Changed title: Incorrect return value type for method returning generic type with bounded type parameter

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 14 Jun 2013 at 1:40

  • Added labels: Priority-High
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 14 Jun 2013 at 4:42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant