add warning in case of effectless command executed on expanded type #68

ramack opened this Issue Mar 20, 2013 · 2 comments

2 participants

Liberty Eiffel member

Liberty should issue a warning in case a command is executed on a qualified expression of expanded type.

See also discussion on

For discussion here:
assume a force_to_bounds(a, b: INTEGER) feature in class INTEGER

class AUX

class TEST
test: is
a_int: INTEGER
create a_aux, 2) -- [1] this has no effect and shall emit the warning
a_int.force_to_bounds(1, 2) -- [2] this has effect and shall just work
my_int.force_to_bounds(1, 2) -- [3] this has effect and shall just work
my_int: INTEGER

The warning shall occur, whenever command (or other feature call with side effects on the call target) is called on a foreign target I. e. with a statement containing at least two dots (.) before the command.

Commands directly executed on local variables or attributes of Current should be find from my understanding.

  • We should check whether this behavior is fully tested.
  • the wiki page on expanded types needs update when the warning is there
Liberty Eiffel member

once we have such a warning, we might consider commands on expanded types in the library. I sometimes wish to have an increment in NUMERIC to substitute
x := x +1

but this would be only cosmetics - in my eyes the latter just looks a bit nicer.

@cadrian cadrian closed this Jun 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment