Skip to content

Fixed #5054, #5287#46

Merged
paulp merged 1 commit intoscala:masterfrom
VladUreche:issue/5054
Dec 8, 2011
Merged

Fixed #5054, #5287#46
paulp merged 1 commit intoscala:masterfrom
VladUreche:issue/5054

Conversation

@VladUreche
Copy link
Contributor

The documents with use cases should be restructured like:

/**

  • The full definition, either used with an implicit value or with an explicit one.
    *
  • Some more explanation on implicits...
    *
  • @param lost a lost parameter
  • @return some integer
    *
  • @usecase def test(): Int
    *
  • This takes the implicit value in scope.
    *
  • Example: test()
    *
  • @usecase def test(explicit: Int): Int
    *
  • This takes the explicit value passed.
    *
  • Example: test(3)
    */
    def test(implicit lost: Int): Int

The documents with use cases should be restructured like:

  /**
   * The full definition, either used with an implicit value or with an explicit one.
   *
   * Some more explanation on implicits...
   *
   * @param lost a lost parameter
   * @return some integer
   *
   * @usecase def test(): Int
   *
   * This takes the implicit value in scope.
   *
   * Example: `test()`
   *
   * @usecase def test(explicit: Int): Int
   *
   * This takes the explicit value passed.
   *
   * Example: `test(3)`
   */
  def test(implicit lost: Int): Int
@paulp paulp merged commit 4da259b into scala:master Dec 8, 2011
lrytz added a commit to lrytz/scala that referenced this pull request Jun 22, 2015
used revision:
scala/scala-java8-compat@9253ed9e7a

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
lrytz added a commit to lrytz/scala that referenced this pull request Jun 23, 2015
used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
lrytz added a commit to lrytz/scala that referenced this pull request Jun 23, 2015
used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
lrytz added a commit to lrytz/scala that referenced this pull request Jun 23, 2015
used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
lrytz added a commit to lrytz/scala that referenced this pull request Jun 23, 2015
including LambdaDeserializer

used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
retronym referenced this pull request in retronym/scala Jun 25, 2015
And also embed LambdaDeserializer

used revision:

   scala/scala-java8-compat@9253ed9

demo:

```
% ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic #44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     #46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  #34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
```
lrytz added a commit to lrytz/scala that referenced this pull request Jun 30, 2015
including LambdaDeserializer

used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
lrytz added a commit to lrytz/scala that referenced this pull request Jun 30, 2015
including LambdaDeserializer

used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
lrytz added a commit to lrytz/scala that referenced this pull request Jun 30, 2015
including LambdaDeserializer

used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
lrytz added a commit to lrytz/scala that referenced this pull request Jun 30, 2015
including LambdaDeserializer

used revision:
scala/scala-java8-compat@9253ed9

demo:

ant -Dlocker.skip=1
build/quick/bin/scala -Ydelambdafy:method -Ybackend:GenBCode -Yopt:closure-elimination -target:jvm-1.8
scala> class C { def f = {val f: Int => Int = x => x + 1; f(10) } }
scala> :javap C
  public int f();
         0: invokedynamic scala#44,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
         5: checkcast     scala#46                 // class scala/Function1
         8: astore_1
         9: aload_1
        10: bipush        10
        12: istore_2
        13: pop
        14: iload_2
        15: invokestatic  scala#34                 // Method $line3$$read$C$$$anonfun$1:(I)I
        18: ireturn
szeiger pushed a commit to szeiger/scala that referenced this pull request Mar 20, 2018
da-liii pushed a commit to da-liii/scala that referenced this pull request Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants