Home Bug Reports

checkCasting to default facet broke in Ruby?

ctennisctennis Member Caleb TennisOrganization: AEIProject: Project GINA ✭✭✭
The documentation state that by using checkedCast with an empty string, we can get back to the default facet of a servant. However, that doesn't seem to be the case with the Ruby bindings:

I've got an object with two facets, the default and one called "unbuffered". With a proxy to the default, I can checkcast and get a proxy to the "unbuffered" facet. However, attempts to go back don't work:

>> r168
=> register/168 -f unbuffered -t @ Unico-tc9
>> r168 = Unico::AnalogOutputRegisterPrx::checkedCast(r168, "")
=> register/168 -f unbuffered -t @ Unico-tc9
>> r168.ice_getFacet
=> "unbuffered"

Maybe I'm just misunderstanding the "trick" to get back to the default facet, but if not it looks like this might be a bug.

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Caleb,

    I agree, that does sound like a bug. Thanks for reporting this.

    As you probably know, a workaround is to call checkedCast like this instead:
    >>> r168 = Unico::AnalogOutputRegisterPrx::checkedCast(r168.ice_facet(""))
    
    Take care,
    - Mark
  • ctennisctennis Member Caleb TennisOrganization: AEIProject: Project GINA ✭✭✭
    Indeed, quite easy to work around. I just found it when toying around while out a new facet in my code. But it smelled like a bug, so I figured it was worthwhile to report. :)

    Caleb
Sign In or Register to comment.