diff --git a/t/04-nativecall/23-incomplete-types.t b/t/04-nativecall/23-incomplete-types.t new file mode 100644 index 00000000000..aaca892a87e --- /dev/null +++ b/t/04-nativecall/23-incomplete-types.t @@ -0,0 +1,22 @@ +use v6; + +use MONKEY-SEE-NO-EVAL; + +use lib ; +use NativeCall :TEST; +use Test; + +plan 6; + +for () -> $cls { + # test the stub case + my $b = ( + "class Stub-$cls is repr('CStruct') " ~ 「{ ... }」, + "class Oops$cls" ~ 「 is repr('」 ~ $cls ~ 「') { HAS Stub-」 ~ $cls ~ 「 $.stubby; }」; + ).join("\n"); + throws-like { EVAL $b }, Exception, :message(/inline.*before.*definition/); + + # self-inlining should fail the same way + my $bad = ("class Oops2$cls is repr(", $cls, ') { HAS Oops2'~$cls~' $.more; }').join(「'」); + throws-like { EVAL $bad }, Exception, :message(/inline.*before.*definition/); +}