### ----------------------------------------------------
### -- annotations
### -- Licenses: Artistic-2.0
### -- Authors: Ben Davies
### -- File: t/02-direct.rakutest
### ----------------------------------------------------
use v6.e.PREVIEW;
use Test;
use annotations <declare direct class>;

plan 1;

annotation Lazy::Static::Buffer is repr<Uninstantiable> {
    method enqueue(::?CLASS: +values) { $?CLASS graffiti values }

    method CALL-ME(::?CLASS: +offsets) { ANN[$?CLASS][offsets] }
}

my @splits := Lazy::Static::Buffer.enqueue: 1...*;
my @intact := Lazy::Static::Buffer.enqueue: 6..10;
sink @splits[0..3];
sink @intact[*];
sink @splits[4];
is Lazy::Static::Buffer(*), <1 2 3 4 6 7 8 9 10 5>,
   "can read and write directly given an package's ANN";


