using GLib; public class Test { int x = 100; public int foo (int bar) requires (bar > 0) ensures (result > 0) { return bar + x; } } public class App { static Test y; public static void* thread_func () { int t; t = y.foo (99); message ("%d", t); return null; } static weak Thread u; static void test () { Test t = new Test (); int j; j = t.foo(100); message ("%d", j); y = #t; u = Thread.create(thread_func, true); } static int main (string[] args) { test (); u.join (); return 1; } }