note description: "Error for invalid assignment." legal: "See notice at end of class." status: "See notice at end of class."; date: "$Date$"; revision: "$Revision $" class VJAR inherit FEATURE_ERROR redefine build_explain end feature -- Properties target_name: STRING; target_type: TYPE_A; -- Target type of the assignment (left part) source_type: TYPE_A; -- Source type of the assignment (right part) code: STRING do Result := "VJAR"; end; feature -- Output build_explain (a_text_formatter: TEXT_FORMATTER) -- Build specific explanation image for current error -- in `a_text_formatter'. local l_target_type: CL_TYPE_A l_source_type: CL_TYPE_A l_same_class_name: BOOLEAN do -- Find out if we should also show the group corresponding to the type -- involved when they have the same name (which would be confusion to the user). --| Note: The same code is present in VUAR2. l_target_type ?= target_type l_source_type ?= source_type if l_target_type /= Void and then l_source_type /= Void then l_same_class_name := l_target_type.class_id /= l_source_type.class_id and then l_target_type.base_class.name.is_equal (l_source_type.base_class.name) end a_text_formatter.add ("Target name: "); a_text_formatter.add (target_name); a_text_formatter.add_new_line; a_text_formatter.add ("Target type: "); target_type.append_to (a_text_formatter); if l_same_class_name then a_text_formatter.add (" (from ") a_text_formatter.add_group (l_target_type.base_class.lace_class.group, l_target_type.base_class.lace_class.target.name) a_text_formatter.add (")") end a_text_formatter.add_new_line; a_text_formatter.add ("Source type: "); source_type.append_to (a_text_formatter); if l_same_class_name then a_text_formatter.add (" (from ") a_text_formatter.add_group (l_source_type.base_class.lace_class.group, l_source_type.base_class.lace_class.target.name) a_text_formatter.add (")") end a_text_formatter.add_new_line end feature {COMPILER_EXPORTER} set_source_type (s: TYPE_A) -- Assign `s' to `source_type'. do source_type := s; end; set_target_type (t: TYPE_A) -- Assign `t' to `target_type'. do target_type := t; end; set_target_name (s: STRING) do target_name := s; end; note copyright: "Copyright (c) 1984-2013, Eiffel Software" license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" licensing_options: "http://www.eiffel.com/licensing" copying: "[ This file is part of Eiffel Software's Eiffel Development Environment. Eiffel Software's Eiffel Development Environment is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License (available at the URL listed under "license" above). Eiffel Software's Eiffel Development Environment is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eiffel Software's Eiffel Development Environment; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ]" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class VJAR