mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:Peter Gummer
Date:2009-05-20T15:21:50.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@222 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -107,6 +107,7 @@ Next you fix the problems that the compiler discovered. The compiler errors conc
|
||||
|
||||
Let's look at some specific cases and how fixing them unfolds.
|
||||
|
||||
===Variables not properly set===
|
||||
|
||||
[[Image:VoidSafeVEVI1]]
|
||||
|
||||
@@ -144,7 +145,7 @@ Here attribute declarations for <code>my_nvp</code> and <code>my_nvp_list</code>
|
||||
</code>
|
||||
|
||||
|
||||
In second case, there is also an Initialization rule violation (VEVI), this time on <code>Result</code>, in this routine:
|
||||
In a second case, there is also an Initialization rule violation (VEVI), this time on <code>Result</code>, in this routine:
|
||||
|
||||
<code>
|
||||
at_first (nm: STRING): NVP is
|
||||
@@ -178,9 +179,11 @@ So the least impact to this routine will be to declare its type as <code>detacha
|
||||
</code>
|
||||
|
||||
|
||||
The same change is made in other routines that can return void by design.
|
||||
The same change is made in other routines that can return void by design, particularly including a routine called <code>value_at_first</code>, which gets our attention next.
|
||||
|
||||
The change to <code>at_first</code> satisfies the VEVI issue in <code>at_first</code>, but it introduces a previously unseen conformance issue (VJAR) in a routine <code>value_at_first</code>:
|
||||
===Source of assignment does not conform to target===
|
||||
|
||||
The change to <code>at_first</code> satisfies the VEVI issue in <code>at_first</code>, but it introduces a previously unseen conformance issue (VJAR) in the routine <code>value_at_first</code>:
|
||||
|
||||
|
||||
[[Image:VoidSafeVJAR1]]
|
||||
@@ -226,6 +229,10 @@ Here the '''attached syntax''' can fix the problem and streamline the routine:
|
||||
|
||||
In this version <code>tn</code> need not be declared as a local variable. Remember that the attached syntax provides a fresh local variable, if the expression is not void.
|
||||
|
||||
===Both VEVI and VJAR errors===
|
||||
|
||||
A design issue in class <code>NVP_LIST</code> causes issues of both conformance and initialization. In the original design, an instance of the class NVP_LIST could traverse its contents NVP-by-NVP with inherited functionality. But it also could traverse its contents returning "sublists" based on recurring patterns of the <code>name</code> attributes of a sequence of name/value pairs.
|
||||
|
||||
|
||||
==Code patterns==
|
||||
|
||||
|
||||
Reference in New Issue
Block a user