We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3786fb6 commit 18a1fcaCopy full SHA for 18a1fca
test/code/class.kyo
@@ -244,3 +244,27 @@ fn main() i32 {
244
var x: X = X(5);
245
return x.add(2);
246
}
247
+
248
+// NAME MethodWithReturnMatch
249
+// ERR 0
250
+// RET 13
251
252
+cdecl fn printf(fmt: char*, ...) i32;
253
254
+class Fibonacci {
255
+ constructor(self: Fibonacci*) {
256
+ }
257
258
+ fn get(self: Fibonacci*, n: i32) i32 {
259
+ return match n {
260
+ 0 => 0,
261
+ 1 => 1,
262
+ default => self.get(n - 1) + self.get(n - 2),
263
+ };
264
265
+}
266
267
+fn main() i32 {
268
+ var fib: Fibonacci = Fibonacci();
269
+ return fib.get(7);
270
0 commit comments