Skip to content

Commit 341b6d5

Browse files
committed
Get natively typed paramters working.
1 parent e417703 commit 341b6d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/NQP/Actions.pm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,14 @@ class NQP::Actions is HLL::Actions {
10261026

10271027
# Set the type of the parameter.
10281028
if $<typename> {
1029-
$past.returns($<typename>[0].ast.value);
1029+
my $type := $<typename>[0].ast.value;
1030+
$past.returns($type);
1031+
if pir::repr_get_primitive_type_spec__IP($type) -> $prim {
1032+
$*W.cur_lexpad().symbol($past.name, :type($type));
1033+
if $past.default && !$<default_value> {
1034+
$past.default(default_value_for_prim($prim));
1035+
}
1036+
}
10301037
}
10311038

10321039
# Set definedness flag (XXX want a better way to do this).

0 commit comments

Comments
 (0)