Skip to content

Commit

Permalink
Revert "Hide ofSize even more from scala3 when using tasty" (#119)
Browse files Browse the repository at this point in the history
This reverts commit 3138763.

Co-authored-by: Samuel Chassot <[email protected]>
  • Loading branch information
mbovel and samuelchassot authored Dec 16, 2024
1 parent d4c2299 commit 3fadc81
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions data-structures/uarray/UArrayExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,16 @@ object UArrayExample:
end UArray

object UArray:
@extern @ignore // used because `new Array[T]` leaks out of @extern due to some compiler magic
def _ofSize[T: ClassTag](size: Int): UArray[T] = {
@extern
def ofSize[T: ClassTag](size: Int): UArray[T] = {
require(0 <= size)
@ghost val definedNot = Array.fill(size)(false)
given ct: realClassTag[T] = summon[ClassTag[T]].real
val content = new Array[T](size)
UArray[T](content, size, definedNot)
}

@extern
def ofSize[T: ClassTag](size: Int): UArray[T] = {
require(0 <= size)
_ofSize[T](size)
}.ensuring(res => res.size == size)


end UArray

def arr3[T: ClassTag](mk: Int => T): Array[T] =
Expand Down

0 comments on commit 3fadc81

Please sign in to comment.