Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@regiskuckaertz
Copy link
Member

@regiskuckaertz regiskuckaertz commented Sep 21, 2019

@iravid is there anything else required for this to be done?

Closes #1526

@adamgfraser
Copy link
Contributor

Nice! After this would be great to see what the other Dotty compatibility issues are, if any.

@regiskuckaertz
Copy link
Member Author

Sadly, that doesn't look so good:

object ChunkBox {
  val array: Array[Int] = Array(1, 2, 3, 4)
  val chunk: Chunk[Int] = Chunk.fromArray(array)
  val arrayOut: Array[Int] = chunk.toArray
}
public final class zio.ChunkBox {
  public static int[] arrayOut();
  public static zio.Chunk<java.lang.Object> chunk();
  public static int[] array();
}

@jdegoes
Copy link
Member

jdegoes commented Sep 21, 2019

@regiskuckaertz What is that boxing example from? Dotty?

@regiskuckaertz
Copy link
Member Author

regiskuckaertz commented Sep 21, 2019

@jdegoes 2.12, actually after I learnt how to use javap 😅

27: astore_3
28: aload_3
29: invokeinterface #40,  1           // InterfaceMethod zio/Chunk.toArray:()Ljava/lang/Object;
34: checkcast     #42                 // class "[I"
37: astore        4
39: new           #12                 // class scala/collection/mutable/ArrayOps$ofInt
42: dup
43: getstatic     #47                 // Field scala/Predef$.MODULE$:Lscala/Predef$;
46: aload         4
48: invokevirtual #51                 // Method scala/Predef$.intArrayOps:([I)[I

@iravid
Copy link
Member

iravid commented Sep 21, 2019

@regiskuckaertz rebase please :-)

@regiskuckaertz
Copy link
Member Author

Done

Copy link
Member

@iravid iravid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woohoo!

@iravid iravid merged commit c6c26ae into zio:master Sep 21, 2019
@regiskuckaertz regiskuckaertz deleted the rk-stream-specialized branch September 21, 2019 17:23
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.

Remove specialization from Chunk in favor of distinct subtypes of Chunk.Arr

4 participants