diff --git a/collects/profj/check.ss b/collects/profj/check.ss index 8785bb6e2a..f6461bd3bf 100644 --- a/collects/profj/check.ss +++ b/collects/profj/check.ss @@ -2157,11 +2157,20 @@ (equal? "super" (special-name-name expr))) (call-abstract-error level name exp-type src)) - (when (and (memq 'protected mods) (reference-type? exp-type) - (or (not (is-eq-subclass? this exp-type type-recs)) - (not (package-members? c-class (cons (ref-type-class/iface exp-type) (ref-type-path exp-type)) - type-recs)))) - (call-access-error 'pro level name exp-type src)) + (when (and (memq 'protected mods) + (reference-type? exp-type)) + (unless (or (is-eq-subclass? this exp-type type-recs) + (let* ((e-class (ref-type-class/iface exp-type)) + (e-path (ref-type-path exp-type)) + (true-path (if (null? e-path) + (send type-recs lookup-path e-class (lambda () null)) + e-path))) + #;(printf "~a ~a ~a~n" c-class (cons e-class true-path) + (send type-recs get-interactions-package)) + (package-members? c-class + (cons e-class true-path) + type-recs))) + (call-access-error 'pro level name exp-type src))) (when (and (memq 'private mods) (reference-type? exp-type) (if static? diff --git a/collects/profj/to-scheme.ss b/collects/profj/to-scheme.ss index 21849c2221..6d932d3353 100644 --- a/collects/profj/to-scheme.ss +++ b/collects/profj/to-scheme.ss @@ -573,7 +573,11 @@ (eq? 'anonymous kind) (eq? 'statement kind)) provides) - ,@(if (null? restricted-methods) + ,@(if (null? (accesses-private methods)) + null + (list + (create-local-names (make-method-names (accesses-private methods) null)))) + #;(if (null? restricted-methods) null (list (create-local-names (append (make-method-names (accesses-private methods) null) restricted-methods))))