On Sat, 13 Jul 2019, Ondrej Pokorny wrote:
Even to such a degree that the compiler would
simply reject your code by not allowing is/at on a variable of the type
itself. Also defendable.
No - not this one. Don't forget about e.g. generics:
function Test<T>(MyValue: T): Boolean;
begin
Result := MyValue is TMyEnum;
end;
would compile for all enumeration types but not for MyValue:TMyEnum.
That doesn't make sense.
Better to have a compiler hint/warning when such a construct is found
and optimized. This perfectly corresponds with the fact that also
constructs like "SmallIntValue is Integer" can be optimized away but
must be allowed.
Fair enough.
Like I said: The point is defendable. So is your point of view.
Personally I am OK with either point of view.
I am just interested in the ordinal, to make an easier check possible.
I think all sides have now been reviewed to the point of boring or
annoying each other almost to death, and we finally need to decide on
whether the patch is applied, and if so, which parts of it.
Michael.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel