From 6487e3f43d5daa943b6a6524dbd1fabdce7c5618 Mon Sep 17 00:00:00 2001 From: Matt Bovel Date: Wed, 11 Dec 2024 15:12:23 +0000 Subject: [PATCH] Revert "Hide ofSize even more from scala3 when using tasty" This reverts commit 3138763f33435bd6747a67e5a30010ff7f89a04e. --- 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] =