Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2474

withSack() Groovy translation output could be simplified

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.4.8
    • Fix Version/s: 3.5.0, 3.4.9
    • Component/s: groovy
    • Labels:
      None

      Description

      There is a bunch of hackery to generate:

      g.withSack((java.util.function.Supplier) {1.0d}, (java.util.function.UnaryOperator) {it + 1}).
        V().sack()
      

      It would be nice if that was just:

      g.withSack({1.0d}, {it + 1}).V().sack()
      

      in earlier version we get this:

      gremlin> g.withSack(1.0d, {it + 1}).V().sack()
      Ambiguous method overloading for method org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource#withSack.
      Cannot resolve which method to invoke for [class java.lang.Double, class groovysh_evaluate$_run_closure1] due to overlapping prototypes between:
      	[class java.lang.Object, interface java.util.function.BinaryOperator]
      	[class java.lang.Object, interface java.util.function.UnaryOperator]
      Type ':help' or ':h' for help.
      Display stack trace? [yN]n
      

        Attachments

          Activity

            People

            • Assignee:
              spmallette Stephen Mallette
              Reporter:
              spmallette Stephen Mallette

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment