From 3fadc8188a783fa8276cde322b3aa11f980b8060 Mon Sep 17 00:00:00 2001 From: Matt Bovel Date: Mon, 16 Dec 2024 11:28:21 +0100 Subject: [PATCH] Revert "Hide ofSize even more from scala3 when using tasty" (#119) This reverts commit 3138763f33435bd6747a67e5a30010ff7f89a04e. Co-authored-by: Samuel Chassot <14821693+samuelchassot@users.noreply.github.com> --- data-structures/uarray/UArrayExample.scala | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/data-structures/uarray/UArrayExample.scala b/data-structures/uarray/UArrayExample.scala index 82709a41..27ea4322 100644 --- a/data-structures/uarray/UArrayExample.scala +++ b/data-structures/uarray/UArrayExample.scala @@ -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] =