Repository navigation
Expand file tree
/
Copy pathtest-data.mo
More file actions
133 lines (113 loc) · 2.5 KB
/
Copy pathtest-data.mo
File metadata and controls
133 lines (113 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import Result "mo:base/Result";
import OrderedMap "mo:base/OrderedMap";
import PureList "mo:core/pure/List";
shared (msg) actor class() {
func letElse() {
let ?x = null else { return };
};
flexible let flexibleLet = 42;
stable let stableLet = 42;
public func hello() : async Text {};
public shared(msg) func sharedCaller() {};
public shared msg func sharedCallerVar() {};
public shared ({ caller }) func sharedCallerPat() {};
transient let transientSomething = flexibleLet + 42;
transient let transientMap = OrderedMap.Make<Nat>(Nat.compare);
transient let transientMap = OrderedMap.Make.Well<Nat>(Nat.compare);
x := 1 + x;
x := x + 2;
x := x - 1;
x := 1 - x;
x := x * 1;
x := 1 * x;
x := x / 1;
x := 1 / x;
x := x # "1";
x := "1" # x;
let _ = { field = field };
let _ = { var dontPun = dontPun };
let _ = switch _ {
case (false) {};
case (true) {};
};
let _ = switch _ {
case true {};
case false {};
};
let _ = switch _ {
case (true, _) {};
case (_, true) {};
};
public func listReturningFunction() : async List<Text> {
null
};
public func setReturningFunction() : async Set.Set<Text> {
null
};
public func mapReturningFunction() : async Map.Map<Text, Nat> {
null
};
public func arrayReturningFunction() : async [Text] {
null
};
func neededReturn() {
return 10;
20
};
func unneededReturn() {
return 10
};
func unneededReturn() = return 10;
func unneededReturn() {
if (true) {
return 4;
} else {
return 5;
20;
};
};
func unneededReturn() {
if (true) return 4
else {
return 5;
20;
};
};
func unneededReturn() {
switch (true) {
case 1 return 40;
case 2 { return 40; };
};
};
type lowerCase = Nat;
type Snake_case = Nat;
type CamelCase<lowerCase, Snake_case> = Nat;
type CamelCase = Nat;
func UpperCase() {};
func snake_case() {};
func _hiddenIsFine() {};
class lowerCase() {};
class Snake_Cased_ish() {};
class CamelCase<lowerCase, Snake_case>() {};
class CamelCase<Camel, Case>() {};
// Deeply nested block (depth 9 — exceeds limit of 8)
func deeplyNested() {
if (true) {
if (true) {
if (true) {
if (true) {
if (true) {
if (true) {
if (true) {
if (true) {
0
};
};
};
};
};
};
};
};
};
}