Skip to content

Commit

Permalink
Tests for RT #113892 and RT #115608.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Nov 26, 2015
1 parent 3966e1b commit d430474
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion S02-names-vars/names.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 144;
plan 149;

# I'm using semi-random nouns for variable names since I'm tired of foo/bar/baz and alpha/beta/...

Expand Down Expand Up @@ -149,4 +149,24 @@ throws-like {
'no Null PMC access when printing a variable typed as ::foo ';
}

# RT #113892
{
my module A {
enum Day is export <Mon Tue>;
sub Day is export { 'sub Day' }
}
import A;
is Day(0), Mon, 'when enum and sub Day exported, Day(0) is enum coercer';
is &Day(), 'sub Day', 'can get sub using & to disamgibuate';
}

# RT #115608
{
my module foo {}
sub foo() { "OH HAI" }
ok foo.HOW ~~ Metamodel::ModuleHOW, 'when module and sub foo, bare foo is module type object';
ok foo().HOW ~~ Metamodel::CoercionHOW, 'when module and sub foo, foo() is coercion type';
is &foo(), 'OH HAI', 'can get sub using & to disambiguate';
}

# vim: ft=perl6

0 comments on commit d430474

Please sign in to comment.