Skip to content

Commit

Permalink
Test coercers don't coerce their default default
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Jan 17, 2018
1 parent 17b2e0b commit 6457b4f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S12-coercion/coercion-types.t
@@ -1,6 +1,8 @@
use v6;
use lib <t/spec/packages>;
use Test;
plan 20;
use Test::Util;
plan 21;

# coercion types in parameter lists
{
Expand Down Expand Up @@ -101,4 +103,13 @@ is Str(Any).gist, '(Str(Any))', 'Can gist a coercion type';
is Int(a), -42, "Sigilless variable does not confuse coercion type parsing";
}

# RT #130479
is_run
class Foo { method Bar {die} }
class Bar is Foo {}
-> Bar(Foo) $foo?, Bar(Foo) :$bar {
say $foo; say $bar;
}()
, {:err(''), :out("(Bar)\n(Bar)\n"), :0status},
'coercers do not attempt to coerce optional params that were not given';
# vim: ft=perl6

0 comments on commit 6457b4f

Please sign in to comment.