/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/API/error/eiffel/unredefined/vuar4.e
ViewVC logotype

Contents of /branches/CAT_mono/Src/Eiffel/API/error/eiffel/unredefined/vuar4.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69844 - (show annotations)
Fri Aug 3 00:52:36 2007 UTC (12 years, 6 months ago) by martins
File size: 4707 byte(s)
added new line to error output
and special treatment of like current as it is not yet marked monomorph automatically
1 indexing
2
3 description:
4 "Error for a feature call: type mismatch on one argument: like Current not allowed on non monomorphic"
5 legal: "See notice at end of class."
6 status: "See notice at end of class.";
7 date: "$Date$";
8 revision: "$Revision $"
9
10 class VUAR4
11
12 inherit
13
14 VUAR
15 redefine
16 build_explain, is_defined, subcode
17 end
18
19 feature -- Properties
20
21 subcode: INTEGER is 4;
22
23 argument_name: STRING;
24 -- Name of the involved argument
25
26 argument_position: INTEGER;
27
28 target_type: TYPE_A;
29 -- Target type of call
30
31 formal_type: TYPE_A;
32 -- Formal type of the argument
33
34 actual_type: TYPE_A;
35 -- Actual type of the call
36
37 feature -- Status report
38
39 is_defined: BOOLEAN is
40 -- Is the error fully defined?
41 do
42 Result := Precursor and then
43 argument_name /= Void and then target_type /= Void and then formal_type /= Void and then actual_type /= Void
44 end
45
46 feature -- Output
47
48 build_explain (a_text_formatter: TEXT_FORMATTER) is
49 -- Build specific explanation image for current error
50 -- in `a_text_formatter'.
51 local
52 l_actual_type: CL_TYPE_A
53 l_formal_type: CL_TYPE_A
54 l_same_class_name: BOOLEAN
55 do
56 -- Find out if we should also show the group corresponding to the type
57 -- involved when they have the same name (which would be confusion to the user).
58 --| Note: The same code is present in VJAR.
59 l_actual_type ?= actual_type
60 l_formal_type ?= formal_type
61 if l_actual_type /= Void and then l_formal_type /= Void then
62 l_same_class_name := l_actual_type.associated_class.name.is_equal (l_formal_type.associated_class.name)
63 end
64
65 print_called_feature (a_text_formatter);
66 a_text_formatter.add ("On target type: ")
67 target_type.append_to (a_text_formatter)
68 a_text_formatter.add_new_line;
69 a_text_formatter.add ("Argument name: ");
70 a_text_formatter.add (argument_name);
71 a_text_formatter.add_new_line;
72 a_text_formatter.add ("Argument position: ");
73 a_text_formatter.add_int (argument_position);
74 a_text_formatter.add_new_line;
75 a_text_formatter.add ("Actual argument type: ");
76 actual_type.append_to (a_text_formatter);
77 if l_same_class_name then
78 a_text_formatter.add (" (from ")
79 a_text_formatter.add_group (l_actual_type.associated_class.lace_class.group,
80 l_actual_type.associated_class.lace_class.target.name)
81 a_text_formatter.add (")")
82 end
83 a_text_formatter.add_new_line;
84 a_text_formatter.add ("Formal argument type: ");
85 formal_type.append_to (a_text_formatter);
86 if l_same_class_name then
87 a_text_formatter.add (" (from ")
88 a_text_formatter.add_group (l_formal_type.associated_class.lace_class.group,
89 l_formal_type.associated_class.lace_class.target.name)
90 a_text_formatter.add (")")
91 end
92 a_text_formatter.add_new_line;
93 end;
94
95 feature {COMPILER_EXPORTER} -- Setting
96
97 set_argument_name (n: STRING) is
98 -- Assign `n' to `argument_name'.
99 do
100 argument_name := n;
101 end;
102
103 set_argument_position (i: INTEGER) is
104 do
105 argument_position := i
106 end;
107
108 set_target_type (a: TYPE_A) is
109 -- Assign `a' to `target_type'.
110 require
111 a_not_void: a /= Void
112 do
113 target_type := a;
114 ensure
115 is_set: target_type = a
116 end
117
118 set_formal_type (t: TYPE_A) is
119 -- Assign `t' to `formal_type'.
120 do
121 formal_type := t;
122 end;
123
124 set_actual_type (a: TYPE_A) is
125 -- Assign `a' to `actual_type'.
126 do
127 actual_type := a;
128 end;
129
130 indexing
131 copyright: "Copyright (c) 1984-2006, Eiffel Software"
132 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
133 licensing_options: "http://www.eiffel.com/licensing"
134 copying: "[
135 This file is part of Eiffel Software's Eiffel Development Environment.
136
137 Eiffel Software's Eiffel Development Environment is free
138 software; you can redistribute it and/or modify it under
139 the terms of the GNU General Public License as published
140 by the Free Software Foundation, version 2 of the License
141 (available at the URL listed under "license" above).
142
143 Eiffel Software's Eiffel Development Environment is
144 distributed in the hope that it will be useful, but
145 WITHOUT ANY WARRANTY; without even the implied warranty
146 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
147 See the GNU General Public License for more details.
148
149 You should have received a copy of the GNU General Public
150 License along with Eiffel Software's Eiffel Development
151 Environment; if not, write to the Free Software Foundation,
152 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
153 ]"
154 source: "[
155 Eiffel Software
156 356 Storke Road, Goleta, CA 93117 USA
157 Telephone 805-685-1006, Fax 805-685-6869
158 Website http://www.eiffel.com
159 Customer support http://support.eiffel.com
160 ]"
161
162 end -- class VUAR3

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23