void () { String s = """ def void f(int x) {} def f(int x) { System.out.println("hello"); } def f(def x) {} void g(x) {} public def void f(def int y) { System.out.println("hello"); } def int f() {}"""; doTest(s, "def $f$($param$)", 5, 2); doTest(s, "def $f$($param$) {}", 3, 1); doTest(s, "void $f$($param$) {}", 2, 2); doTest(s, "void $f$(def x)", 2, 0); doTest(s, "def $f$(def x)", 4, 1); doTest(s, "void $f$(def $x$)", 3, 0); doTest(s, "void $f$(int $x$)", 2, 2); doTest(s, "def $f$(int $x$)", 3, 1); doTest(s, "def g($param$)", 1, 0); doTest(s, "def '_T1('_T2*)", 6, 2); // a problem with default eq is that ; is not part of statement doTest(s, "def '_T1('_T2*) {'_T3+}", 2, 0); doTest(s, "def '_T1('_T2*) {'_T3*}", 6, 1); }