Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Toybox.System;
- class Utils {
- typedef MyTuple as [String, String, Number, Number];
- }
- var t as Utils.MyTuple = ["a", "b", 3, 4];
- function foo(x as Utils.MyTuple) as Utils.MyTuple {
- return x;
- }
- function bar(x as [String, String, Number, Number]) as Utils.MyTuple {
- return x;
- }
- function baz() as Void {
- var x = foo(t);
- bar(t);
- foo(["c", "d", 5, 6]);
- bar(["c", "d", 5, 6]);
- System.println(42 + x[2] + x[3]);
- System.println(x[0].substring(0,1));
- }
Advertisement
Add Comment
Please, Sign In to add comment