Correction to bug for accessing private field

svn: r2791
This commit is contained in:
Kathy Gray 2006-04-26 04:33:09 +00:00
parent bdcaaa5c35
commit f0564d5746
2 changed files with 11 additions and 1 deletions

View File

@ -2257,7 +2257,7 @@
(javaRuntime:nullError 'field)
(send ,expr ,(translate-id field-string field-src)))
(build-src src))))
((and (eq? (var-access-access access) 'private) (or (static-method) (inner-class)))
((and (eq? (var-access-access access) 'private) #;(or (static-method) (inner-class)))
(let* ((id (create-get-name field-string (var-access-class access)))
(getter `(send ,expr ,id ,expr))
(get-syntax (if cant-be-null?

View File

@ -347,6 +347,16 @@ class WeeklyPlanner{
(list (make-java-string "llo"))
"Test of substring")
(interact-test
"class A2 {
private int a;
A2(int a) { this.a = a; }
int g(A2 b) { return b.a; }
}"
'advanced
(list "new A2(1).g(new A2(2))")
(list 2)
"Test of private field access")
(report-test-results)