Ho il seguente codice:
vertex è di tipo ColoredGraph<V, Object>.Vertexcodice:var n = from e in vertex.OutgoingEdgesList select e.End;
e è di tipo ColoredGraph<V, Object>.Edge
vertex.OutgoingEdgesList è di tipo List<ColoredGraph<V, Object>.Edge>
Tutti i tipi vengono riconosciuti correttamente dall'engine LINQ. Tuttavia appare questo errore:
Anche scrivendo:The type of the expression in the select clause is incorrect. Type inference failed in the call to 'Select'.
dove il tipo è chiaramente Int32, mi dà lo stesso errore.codice:var n = from e in vertex.OutgoingEdgesList select 1;
E' assurdo che pur riuscendo a inferire il tipo dell'oggetto selezionato non possa inferiore il tipo corrispondente alla sua collezione, che dovrebbe essere IEnumerable<ColoredGraph<V, Object>.Vertex>.

Rispondi quotando