Forum: IronRuby Code Review: Protected3

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tomas M. (Guest)
on 2009-05-22 02:33
(Received via mailing list)
Attachment: Protected3.diff (0 Bytes)
tfpt review "/shelveset:Protected3;REDMOND\tomat"

Small changes in DLR.

  Fixes handling of CLR protected and private methods and properties.
  Enables generic methods in ClsTypeEmitter.
  Removes RubyCallFlag.TryCall - it's not used anymore.

  Notes on visibility:
  Ruby visibility is orthogonal to CLR visibility.
  Ruby visibility is mutable (can be changed using
Kernel#public/private/protected methods), CLR visibility is not.
  A CLR method group can comprise of methods of different CLR
visibility. Ruby visibility applies on the group as a whole.

  Ruby-protected members can only be called from a scope whose self
immediate class is a descendant of the method owner.
  CLR-protected members can only be called if the receiver is a
descendant of the method owner.

  Ruby-private members can only be called with an implicit receiver
  CLR-private members can only be called in PrivateBinding mode
(-X:PrivateBinding command line option), the receiver might be explicit
or implicit.

  Since protected methods can only be called on a derived class instance
the specs need to be adjusted accordingly.
  I've fixed generic_spec nad overload_spec and commented out a block in
protected_spec - all the cases there need to be changed to negative
cases (all should fail).
  Removed ROWAN_BIN check in
External.LCA_RESTRICTED\Languages\IronRuby\mspec\default.mspec so that
mspec picks up IR_OPTIONS even if ROWAN_BIN is not set.

Curt H. (Guest)
on 2009-05-22 02:39
(Received via mailing list)
Looks good!
Jim D. (Guest)
on 2009-05-22 02:44
(Received via mailing list)
For the protected tests, can you add specs that test that the protected
.NET methods are callable from an instance_eval?

@klass.instance_eval {public_protected_overload("abc")}.should
equal_clr_string("protected overload")

Don't worry about protected_spec though, I'll fix that.

Other than that, test looks good.


...there is no try
Jim D. (Guest)
on 2009-05-22 02:56
(Received via mailing list)
After chatting with Tomas, not adding those tests makes sense due to
differences in CLR protected behavior. I misunderstood his explanation


...there is no try
This topic is locked and can not be replied to.