Debian Codegraph @

src/test/06-Errors/error-static-init-local-f.ck

raw
1 // error test: calling local (non-class) fun in static initialization
2 // #2024-static-init
3
4 // local function
5 fun int foo() { return 5; }
6
7 // non-public class (calling local functions allowed, except
8 // for static initialization)
9 class Foo
10 {
11 // ERROR calling local fun in static initialization statement
12 foo() => static int THE_NUM;
13 }