end
redef fun to_s: String do
+ var file_part = file
+ if file_part.length > 0 then file_part += ":"
+
if line_start == line_end then
if column_start == column_end then
- return "{file}:{line_start},{column_start}"
+ return "{file_part}{line_start},{column_start}"
else
- return "{file}:{line_start},{column_start}--{column_end}"
+ return "{file_part}{line_start},{column_start}--{column_end}"
end
else
- return "{file}:{line_start},{column_start}--{line_end}:{column_end}"
+ return "{file_part}{line_start},{column_start}--{line_end}:{column_end}"
+ end
+ end
+
+ fun relative_to(loc: nullable Location): String do
+ var relative: Location
+ if loc != null and loc.file == self.file then
+ relative = new Location("", self.line_start, self.line_end, self.column_start, self.column_end)
+ else
+ relative = new Location(self.file, self.line_start, self.line_end, self.column_start, self.column_end)
end
+ return relative.to_s
end
redef fun <(other: OTHER): Bool do
if node == null then
error(n, "Type error: no most general type. Got {n.stype} and {stype}.")
else
- error(n, "Type error: no most general type. Got {n.stype} and {stype} at {node.locate}.")
+ var loc = node.location
+ if loc == null then
+ error(n, "Type error: no most general type. Got {n.stype} and {stype} at ????.")
+ else
+ error(n, "Type error: no most general type. Got {n.stype} and {stype} at {loc.relative_to(n.location)}.")
+ end
end
return null
end
-alt/base_array_alt1.nit:27,15--18: Type error: no most general type. Got Bool and Int at alt/base_array_alt1.nit:27,11--12.
+alt/base_array_alt1.nit:27,15--18: Type error: no most general type. Got Bool and Int at 27,11--12.
./base_closure6.nit:55,25: Type error: no most general type. Got V and U.
-./base_closure6.nit:65,8: Type error: no most general type. Got V and U at ./base_closure6.nit:64,8.
+./base_closure6.nit:65,8: Type error: no most general type. Got V and U at 64,8.
alt/base_closure6_alt1.nit:53,5--25: Type error: expected U, got T
alt/base_closure6_alt1.nit:55,25: Type error: no most general type. Got V and U.
alt/base_closure6_alt1.nit:57,5--61:8: Type error: expected U, got T
-alt/base_closure6_alt1.nit:65,8: Type error: no most general type. Got V and U at alt/base_closure6_alt1.nit:64,8.
+alt/base_closure6_alt1.nit:65,8: Type error: no most general type. Got V and U at 64,8.
-alt/base_if_expr_alt1.nit:39,35: Type error: no most general type. Got Int and A at alt/base_if_expr_alt1.nit:39,24--28.
+alt/base_if_expr_alt1.nit:39,35: Type error: no most general type. Got Int and A at 39,24--28.
-./error_array_ambig.nit:17,13--15: Type error: no most general type. Got Char and Int at ./error_array_ambig.nit:17,10.
+./error_array_ambig.nit:17,13--15: Type error: no most general type. Got Char and Int at 17,10.
-alt/test_array_comb_alt1.nit:23,19--21: Type error: no most general type. Got String and nullable Int at alt/test_array_comb_alt1.nit:23,16.
+alt/test_array_comb_alt1.nit:23,19--21: Type error: no most general type. Got String and nullable Int at 23,16.
-alt/test_array_comb_alt2.nit:24,19--21: Type error: no most general type. Got String and nullable Int at alt/test_array_comb_alt2.nit:24,16.
+alt/test_array_comb_alt2.nit:24,19--21: Type error: no most general type. Got String and nullable Int at 24,16.