Guest User

okgarmin

a guest
Jan 22nd, 2025
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import Toybox.System;
  2.  
  3. class Utils {
  4. typedef MyTuple as [String, String, Number, Number];
  5. }
  6.  
  7. var t as Utils.MyTuple = ["a", "b", 3, 4];
  8.  
  9. function foo(x as Utils.MyTuple) as Utils.MyTuple {
  10. return x;
  11. }
  12.  
  13. function bar(x as [String, String, Number, Number]) as Utils.MyTuple {
  14. return x;
  15. }
  16.  
  17. function baz() as Void {
  18. var x = foo(t);
  19. bar(t);
  20. foo(["c", "d", 5, 6]);
  21. bar(["c", "d", 5, 6]);
  22.  
  23. System.println(42 + x[2] + x[3]);
  24. System.println(x[0].substring(0,1));
  25. }
Advertisement
Add Comment
Please, Sign In to add comment