[
https://issues.apache.org/jira/browse/TINKERPOP3-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15007227#comment-15007227
]
Bob Briody commented on TINKERPOP3-800:
---------------------------------------
I don't have an emotional investment in this ticket. At one point I had a use
case where it may have been useful to inspect the return type of each Step as a
way to provide the user with 'describe-like' info about their traversal, but
that is no longer a thing.
> [Proposal] Domain/Range checking during traversal construction.
> ---------------------------------------------------------------
>
> Key: TINKERPOP3-800
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-800
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.0.2-incubating
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
>
> I think we should add two new methods to {{Step}}.
> {code}
> Step.getDomain() -> Class
> Step.getRange() -> Class
> {code}
> Now, when someone does:
> {code}
> g.V().out()
> {code}
> {{GraphStep}} will report that its range is {{Vertex.class}}. {{VertexStep}}
> will report its domain to be {{Vertex.class}}. Good. No typing issues.
> However, when you do this:
> {code}
> g.E().out()
> {code}
> {{GraphStep}} will report that its range is {{Edge.class}}. {{VertexStep}}
> will report its domain to be {{Vertex.class}} --- {{IllegalArgumentException:
> "The provided traversal has an illegal function composition."}}.
> Why is this good -- much better than getting random {{ClassCastExceptions}}
> at execution time.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)