Bug fix for order of field evaluation
svn: r2342
This commit is contained in:
parent
873e71a9dd
commit
1c85dd7504
|
@ -1754,12 +1754,12 @@
|
|||
(case kind
|
||||
((file) (format "Required file ~a, for class or interface ~a, not found"
|
||||
(string-append (path->ext path) ".java") (path->ext path)))
|
||||
((dir) (format "Required directory ~a not found" (path->ext path))))
|
||||
((dir) (format "Required directory, for package ~a not found" (path->ext path))))
|
||||
k src))
|
||||
(raise-error (string->symbol (car path))
|
||||
(case kind
|
||||
((file) (format "Class or interface ~a is not known" (path->ext path)))
|
||||
((dir) (format "Directory to search, ~a, is not known" (path->ext path))))
|
||||
((file) (format "Class or interface ~a is not known." (path->ext path)))
|
||||
((dir) (format "Package ~a is not known." (path->ext path))))
|
||||
(string->symbol (car path))
|
||||
src)))
|
||||
|
||||
|
|
|
@ -605,18 +605,18 @@
|
|||
(else (cons (string->symbol (format "~a~~f" (car args)))
|
||||
(loop (cdr args)))))))))
|
||||
,@(let ((translated-fields (map
|
||||
(lambda (f) (translate-field (map modifier-kind (field-modifiers f))
|
||||
(field-type-spec f)
|
||||
(field-name f)
|
||||
(and (var-init? f) f)
|
||||
(if (var-init? f)
|
||||
(var-init-src f)
|
||||
(var-decl-src f))
|
||||
#f))
|
||||
(append (accesses-public fields)
|
||||
(accesses-package fields)
|
||||
(accesses-protected fields)
|
||||
(accesses-private fields)))))
|
||||
(lambda (f)
|
||||
(translate-field (map modifier-kind (field-modifiers f))
|
||||
(field-type-spec f)
|
||||
(field-name f)
|
||||
(and (var-init? f) f)
|
||||
(if (var-init? f)
|
||||
(var-init-src f)
|
||||
(var-decl-src f))
|
||||
#f))
|
||||
(reverse (filter (lambda (f)
|
||||
(not (memq 'static (map modifier-kind (field-modifiers f)))))
|
||||
(members-field class-members))))))
|
||||
(append
|
||||
(map car translated-fields)
|
||||
(map cadr translated-fields)))
|
||||
|
|
|
@ -234,6 +234,29 @@ class WeeklyPlanner{
|
|||
|
||||
;;Interaction tests, mix of right and error
|
||||
|
||||
(interact-test
|
||||
"class A {
|
||||
private int x = 10;
|
||||
public int y = x * 2;
|
||||
}
|
||||
class B {
|
||||
public int x = 10;
|
||||
private int y = x * 2;
|
||||
public int report() { return y; }
|
||||
}
|
||||
class C {
|
||||
public int x = 10;
|
||||
public int y = 2 * x;
|
||||
}
|
||||
class D {
|
||||
int x = 10;
|
||||
public int y = 2 * x;
|
||||
}"
|
||||
'advanced
|
||||
'("A a = new A();" "B b = new B();" "C c = new C();" "D d = new D();" "a.y" "b.report()" "c.y" "d.y")
|
||||
'((void) (void) (void) (void) 20 20 20 20)
|
||||
"Private, etc shouldn't effect order of evaluation")
|
||||
|
||||
(interact-test
|
||||
"public class X {
|
||||
private int x() { return 3; }
|
||||
|
|
Loading…
Reference in New Issue
Block a user