New CAT call: Difference between revisions

From EiffelStudio: an EiffelSoftware project
Jump to navigation Jump to search
Konradm (talk | contribs)
mNo edit summary
 
Konradm (talk | contribs)
Line 4: Line 4:
{|border="0" cellpadding="2" cellspacing="0" align="center"
{|border="0" cellpadding="2" cellspacing="0" align="center"
|-valign="top" -halign="center"
|-valign="top" -halign="center"
|
<code>[eiffel,N]
class
  Y
feature
  a: B
  g
      do
        a.f1
      end
end
</code>
|
|
<code>[eiffel, n]
<code>[eiffel, n]
Line 28: Line 16:
   f (a: STRING) do end  -- not valid
   f (a: STRING) do end  -- not valid
</code>
</code>
|}
|
<code>[eiffel, n]
<code>[eiffel, n]
class B
class B
Line 34: Line 22:
   f (a: ?STRING) do end  -- valid
   f (a: ?STRING) do end  -- valid
</code>
</code>
|}

Revision as of 20:11, 27 October 2006

Introcution

The ECMA standard introduces a new solution to the CAT call problem. Covariant redefinition of a formal argument is only possible to an detatchable type:

class A
feature
   f (a: ANY) do end
class B
feature
   f (a: STRING) do end   -- not valid
class B
feature
   f (a: ?STRING) do end   -- valid