29 |
set_frozen_mark |
set_frozen_mark |
30 |
end |
end |
31 |
|
|
32 |
|
create |
33 |
|
make |
34 |
|
|
35 |
|
feature {NONE} -- Initialization |
36 |
|
|
37 |
|
make (a_type: TYPE_A) |
38 |
|
-- Initialize Current and assign `a_type' to `conformance_type'. |
39 |
|
do |
40 |
|
set_actual_type (a_type) |
41 |
|
end |
42 |
|
|
43 |
feature -- Visitor |
feature -- Visitor |
44 |
|
|
45 |
process (v: TYPE_A_VISITOR) |
process (v: TYPE_A_VISITOR) |
62 |
context_free_type: like Current |
context_free_type: like Current |
63 |
-- <Precursor> |
-- <Precursor> |
64 |
do |
do |
65 |
create Result |
create Result.make (conformance_type.context_free_type) |
|
Result.set_actual_type (conformance_type.context_free_type) |
|
66 |
end |
end |
67 |
|
|
68 |
conformance_type: TYPE_A |
conformance_type: TYPE_A |
391 |
if |
if |
392 |
attached {LIKE_CURRENT} other as a and then |
attached {LIKE_CURRENT} other as a and then |
393 |
(a_context_class.lace_class.is_void_safe_conformance implies is_attachable_to (a)) and then |
(a_context_class.lace_class.is_void_safe_conformance implies is_attachable_to (a)) and then |
394 |
is_processor_attachable_to (a) and then not a.has_frozen_mark |
is_processor_attachable_to (a) and then (a.has_frozen_mark implies has_frozen_mark) |
395 |
then |
then |
396 |
-- Other is like Current that is compatible in terms of attachment status, separate status |
-- Other is like Current that is compatible in terms of attachment status, separate status |
397 |
-- and variance status. |
-- and variance status. |
398 |
--| Note that if other is frozen then we have to use the normal conformance rules. |
--| Note that if other is frozen and we are not frozen, then we have to use the normal conformance rules. |
399 |
Result := True |
Result := True |
400 |
else |
else |
401 |
-- Other is not `like Current' we apply normal rules of conformance. |
-- Other is not `like Current' we apply normal rules of conformance. |
445 |
else |
else |
446 |
conformance_type := a.to_other_immediate_attachment (Current) |
conformance_type := a.to_other_immediate_attachment (Current) |
447 |
end |
end |
448 |
|
conformance_type := conformance_type.to_other_variant (Current) |
449 |
actual_type := Current |
actual_type := Current |
450 |
end |
end |
451 |
|
|
609 |
-- We cannot allow aliasing as otherwise we might end up updating |
-- We cannot allow aliasing as otherwise we might end up updating |
610 |
-- `like Current' type that should not be updated (Allowing the |
-- `like Current' type that should not be updated (Allowing the |
611 |
-- aliasing would break eweasel test#valid218). |
-- aliasing would break eweasel test#valid218). |
612 |
create l_like |
create l_like.make (class_type.conformance_type) |
|
l_like.set_actual_type (class_type.conformance_type) |
|
613 |
Result := l_like |
Result := l_like |
614 |
end |
end |
615 |
Result := Result.to_other_attachment (Current) |
Result := Result.to_other_attachment (Current) |
623 |
evaluated_type_in_descendant (a_ancestor, a_descendant: CLASS_C; a_feature: FEATURE_I): LIKE_CURRENT |
evaluated_type_in_descendant (a_ancestor, a_descendant: CLASS_C; a_feature: FEATURE_I): LIKE_CURRENT |
624 |
do |
do |
625 |
if a_ancestor /= a_descendant then |
if a_ancestor /= a_descendant then |
626 |
create Result |
create Result.make (a_descendant.actual_type) |
|
Result.set_actual_type (a_descendant.actual_type) |
|
627 |
Result := Result.to_other_attachment (Current) |
Result := Result.to_other_attachment (Current) |
628 |
-- Promote separateness status if present. |
-- Promote separateness status if present. |
629 |
if is_separate then |
if is_separate then |
655 |
-- when processing an inherited routine using `like Current' |
-- when processing an inherited routine using `like Current' |
656 |
-- we keep LIKE_CURRENT for the metatype, but simply replace |
-- we keep LIKE_CURRENT for the metatype, but simply replace |
657 |
-- its `conformance_type' with its `meta_type'. |
-- its `conformance_type' with its `meta_type'. |
658 |
create Result |
create Result.make (conformance_type.meta_type) |
|
Result.set_actual_type (conformance_type.meta_type) |
|
659 |
end |
end |
660 |
|
|
661 |
note |
note |
662 |
copyright: "Copyright (c) 1984-2013, Eiffel Software" |
copyright: "Copyright (c) 1984-2014, Eiffel Software" |
663 |
license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" |
license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" |
664 |
licensing_options: "http://www.eiffel.com/licensing" |
licensing_options: "http://www.eiffel.com/licensing" |
665 |
copying: "[ |
copying: "[ |