Full class checking and export {NONE} all

8 messages Options
Embed this post
Permalink
Peter Gummer-2

Full class checking and export {NONE} all

Reply Threaded More More options
Print post
Permalink
Just to see what would happen, I turned on full class checking for one
of our projects and recompiled it from scratch in EiffelStudio 6.4.
There were several interesting VUAR(2) "non-conforming actual argument"
errors that I suppose we should fix.

But there were dozens of surprising VUEX(2) errors, "Feature of
qualified call not available to client class". All of them are in class
ANY, in features deep_copy, standard_is_equal and is_deep_equal. In each
case, the actual class has an inheritance clause like this:

    inherit
       SOME_ANCESTOR
          export
             {NONE} all
          end

Some variation on that.

So obviously the problem is that those three features of ANY are calling
some (possibly other) feature of ANY on some other target object, but
our descendant is hiding all of ANY's features. Because full-class
checking seeks out invalid calls in ancestors, it detects that the
ancestor is trying to make a qualified call on a feature that is not
exported to it in the descendant.

What's the recommended way to deal with this?

- Peter Gummer

Eric Bezault

Re: Full class checking and export {NONE} all

Reply Threaded More More options
Print post
Permalink
Peter Gummer wrote:

> Just to see what would happen, I turned on full class checking for one
> of our projects and recompiled it from scratch in EiffelStudio 6.4.
> There were several interesting VUAR(2) "non-conforming actual argument"
> errors that I suppose we should fix.
>
> But there were dozens of surprising VUEX(2) errors, "Feature of
> qualified call not available to client class". All of them are in class
> ANY, in features deep_copy, standard_is_equal and is_deep_equal. In each
> case, the actual class has an inheritance clause like this:
>
>     inherit
>        SOME_ANCESTOR
>           export
>              {NONE} all
>           end
>
> Some variation on that.
>
> So obviously the problem is that those three features of ANY are calling
> some (possibly other) feature of ANY on some other target object, but
> our descendant is hiding all of ANY's features. Because full-class
> checking seeks out invalid calls in ancestors, it detects that the
> ancestor is trying to make a qualified call on a feature that is not
> exported to it in the descendant.
>
> What's the recommended way to deal with this?

Make sure that these features are exported. The trick is as follows:

      inherit

         ANY

         SOME_ANCESTOR
            export
               {NONE} all
            end


--
Eric Bezault
mailto:[hidden email]
http://www.gobosoft.com
Peter Gummer-2

Re: Full class checking and export {NONE} all

Reply Threaded More More options
Print post
Permalink
Eric Bezault wrote:

> Make sure that these features are exported. The trick is as follows:
>
>       inherit
>
>          ANY
>
>          SOME_ANCESTOR
>             export
>                {NONE} all
>             end
>  

I suspected as much. Thanks very much, Eric.

- Peter Gummer

Jonathan S. Ostroff

E6.4 release candidate 9263/ Object test

Reply Threaded More More options
Print post
Permalink
I am having difficulty with the object test construct using full void safety
(see ecf file below). I am wondering how to do an object test in a check
statement? The various errors I get are:


        make
                local
                        v: detachable STRING
                do
                        -- #1 syntax error
-- check attached {STRING} v as x then
-- x.append_character('a')
-- end

                        -- #2 this works
-- if attached {STRING} v as x then
-- x.append_character('a')
-- end

                        -- #3 VEEN error/obsolete warning
-- check {x:STRING} v end
-- x.append_character('a')

                        -- #4 this works
                        check v /= Void end
                        v.append_character ('a')
                end


====
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0
http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="cell"
uuid="8C9D79DF-C9FA-468F-B1F0-F86EB29854E5">
        <target name="cell">
                <root class="APPLICATION" feature="make"/>
                <option warning="true" full_class_checking="true"
cat_call_detection="true" is_attached_by_default="true" void_safety="all"
syntax="standard">
                        <assertions precondition="true" postcondition="true"
check="true" invariant="true" loop="true" supplier_precondition="true"/>
                </option>
                <library name="base"
location="$ISE_EIFFEL\library\base\base-safe.ecf"/>
                <cluster name="cell" location=".\" recursive="true">
                        <file_rule>
                                <exclude>/EIFGENs$</exclude>
                                <exclude>/.svn$</exclude>
                                <exclude>/CVS$</exclude>
                        </file_rule>
                </cluster>
        </target>
</system>

Peter Gummer-2

Re: E6.4 release candidate 9263/ Object test

Reply Threaded More More options
Print post
Permalink
Jonathan S. Ostroff wrote:
> ... I am wondering how to do an object test in a check statement?
>  

Like this, perhaps (although I haven't tried it):

        check attached {STRING} v as x end
        x.append_character('a')


- Peter Gummer

Jonathan S. Ostroff

RE: E6.4 release candidate 9263/ Object test

Reply Threaded More More options
Print post
Permalink
Peter:

I tried that but it gives a VEEN error.

Jonathan

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Peter Gummer
Sent: Sunday, June 21, 2009 6:41 PM
To: [hidden email]
Subject: Re: [eiffel_software] E6.4 release candidate 9263/ Object test

Jonathan S. Ostroff wrote:
> ... I am wondering how to do an object test in a check statement?
>  

Like this, perhaps (although I haven't tried it):

        check attached {STRING} v as x end
        x.append_character('a')


- Peter Gummer



Alexander Kogtenkov [ES]-2

Re: E6.4 release candidate 9263/ Object test

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jonathan S. Ostroff
At the moment the compiler does not support the new proposed syntax for a check
instruction. As to the usual check instruction, the scope of an object test local is
limited to this instruction. So, it's possible to have

    check
        v_attached: attached v
    end

    check
        v_attached: attached v as x
        x_not_empty: not x.is_empty
    end

but not

    check
        v_attached: attached v as x
    end
    x.append_character('a')

Regards,
Alexander Kogtenkov


----- Original Message -----
From: "Jonathan S. Ostroff" <[hidden email]>
To: <[hidden email]>
Sent: Monday, June 22, 2009 12:58 AM
Subject: [eiffel_software] E6.4 release candidate 9263/ Object test


>I am having difficulty with the object test construct using full void safety
> (see ecf file below). I am wondering how to do an object test in a check
> statement? The various errors I get are:
>
>
> make
> local
> v: detachable STRING
> do
> -- #1 syntax error
> -- check attached {STRING} v as x then
> -- x.append_character('a')
> -- end
>
> -- #2 this works
> -- if attached {STRING} v as x then
> -- x.append_character('a')
> -- end
>
> -- #3 VEEN error/obsolete warning
> -- check {x:STRING} v end
> -- x.append_character('a')
>
> -- #4 this works
> check v /= Void end
> v.append_character ('a')
> end
>
>
> ====
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0
> http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="cell"
> uuid="8C9D79DF-C9FA-468F-B1F0-F86EB29854E5">
> <target name="cell">
> <root class="APPLICATION" feature="make"/>
> <option warning="true" full_class_checking="true"
> cat_call_detection="true" is_attached_by_default="true" void_safety="all"
> syntax="standard">
> <assertions precondition="true" postcondition="true"
> check="true" invariant="true" loop="true" supplier_precondition="true"/>
> </option>
> <library name="base"
> location="$ISE_EIFFEL\library\base\base-safe.ecf"/>
> <cluster name="cell" location=".\" recursive="true">
> <file_rule>
> <exclude>/EIFGENs$</exclude>
> <exclude>/.svn$</exclude>
> <exclude>/CVS$</exclude>
> </file_rule>
> </cluster>
> </target>
> </system>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
helmut.brandl

Re: E6.4 release candidate 9263/ Object test

Reply Threaded More More options
Print post
Permalink
I have seen in EiffelBase that the following works:

  v: detachable STRING
  ...
  ...
  check v /= Void end
  v.append_character('a')

The question: If assertion monitoring is switched off, the check
instruction shall still throw an exception if v is not attached. Is this
implemented or do I get the void target exception at the following
statement (which I should not get in void safe Eiffel)?

Helmut


Alexander Kogtenkov wrote:

> At the moment the compiler does not support the new proposed syntax for a check
> instruction. As to the usual check instruction, the scope of an object test local is
> limited to this instruction. So, it's possible to have
>
>     check
>         v_attached: attached v
>     end
>
>     check
>         v_attached: attached v as x
>         x_not_empty: not x.is_empty
>     end
>
> but not
>
>     check
>         v_attached: attached v as x
>     end
>     x.append_character('a')
>
> Regards,
> Alexander Kogtenkov
>
>
> ----- Original Message -----
> From: "Jonathan S. Ostroff" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, June 22, 2009 12:58 AM
> Subject: [eiffel_software] E6.4 release candidate 9263/ Object test
>
>
>> I am having difficulty with the object test construct using full void safety
>> (see ecf file below). I am wondering how to do an object test in a check
>> statement? The various errors I get are:
>>
>>
>> make
>> local
>> v: detachable STRING
>> do
>> -- #1 syntax error
>> -- check attached {STRING} v as x then
>> -- x.append_character('a')
>> -- end
>>
>> -- #2 this works
>> -- if attached {STRING} v as x then
>> -- x.append_character('a')
>> -- end
>>
>> -- #3 VEEN error/obsolete warning
>> -- check {x:STRING} v end
>> -- x.append_character('a')
>>
>> -- #4 this works
>> check v /= Void end
>> v.append_character ('a')
>> end
>>
>>
>> ====
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0
>> http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="cell"
>> uuid="8C9D79DF-C9FA-468F-B1F0-F86EB29854E5">
>> <target name="cell">
>> <root class="APPLICATION" feature="make"/>
>> <option warning="true" full_class_checking="true"
>> cat_call_detection="true" is_attached_by_default="true" void_safety="all"
>> syntax="standard">
>> <assertions precondition="true" postcondition="true"
>> check="true" invariant="true" loop="true" supplier_precondition="true"/>
>> </option>
>> <library name="base"
>> location="$ISE_EIFFEL\library\base\base-safe.ecf"/>
>> <cluster name="cell" location=".\" recursive="true">
>> <file_rule>
>> <exclude>/EIFGENs$</exclude>
>> <exclude>/.svn$</exclude>
>> <exclude>/CVS$</exclude>
>> </file_rule>
>> </cluster>
>> </target>
>> </system>
>>
>>
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>