From 960e4410f76801356ebd42801c914b2910a302a7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 18 Nov 2024 08:21:58 -0300 Subject: v0 migration to mkwb --- .../pastebins/2019/12/29/raku-tuple-type.adoc | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/content/pastebins/2019/12/29/raku-tuple-type.adoc (limited to 'src/content/pastebins/2019/12/29') diff --git a/src/content/pastebins/2019/12/29/raku-tuple-type.adoc b/src/content/pastebins/2019/12/29/raku-tuple-type.adoc new file mode 100644 index 0000000..3d5ff34 --- /dev/null +++ b/src/content/pastebins/2019/12/29/raku-tuple-type.adoc @@ -0,0 +1,37 @@ +--- + +title: Raku tuple type annotation + +date: 2019-12-29 + +layout: post + +lang: en + +ref: raku-tuple-type-annotation + +--- + +```perl +# Single Str return value: this works +sub f1(Str $in --> Str) { + $in; +} + +# Tuple of Str as return value: this works +sub f2(Str $in) { + ($in, $in); +} + +# Tuple of Str as return value with type annotation: this doesn't works +sub f2(Str $in --> (Str, Str)) { + ($in, $in); +} +``` + +Error log is: + +```perl +===SORRY!=== Error while compiling /path/to/my/file +Malformed return value +``` -- cgit v1.2.3