Show error when declarations do not start with fn in interfaces. #1565. Some added functionality to lists and time.

This commit is contained in:
Christoffer Lerno
2024-10-18 17:10:00 +02:00
parent c013006671
commit 78d5939d9d
6 changed files with 34 additions and 0 deletions

View File

@@ -245,6 +245,11 @@ fn Type! LinkedList.pop(&self)
return self._last.value;
}
fn bool LinkedList.is_empty(&self)
{
return !self._first;
}
fn Type! LinkedList.pop_front(&self)
{
if (!self._first) return IteratorResult.NO_MORE_ELEMENT?;

View File

@@ -46,6 +46,7 @@ fn void PrivatePriorityQueue.temp_init(&self, usz initial_capacity = 16) @inline
self.heap.new_init(initial_capacity, allocator::temp()) @inline;
}
fn void PrivatePriorityQueue.push(&self, Type element)
{
self.heap.push(element);
@@ -66,6 +67,15 @@ fn void PrivatePriorityQueue.push(&self, Type element)
}
}
fn void PrivatePriorityQueue.remove_at(&self, usz index)
{
if (index == 0)
{
self.pop()!!;
return;
}
self.heap.remove_at(index);
}
<*
@require self != null
*>