pollIs this ok to remove conversion from STRING_32 to STRING_8?

Yes
100% (9 votes)
No
0% (0 votes)
Total votes: 9

Comments

It is ok for me, and I would

Jocelyn Fiat's picture

It is ok for me, and I would say, I hope we will remove this conversion since this is the cause of many Call on Void target when we have

s32: STRING_32
s8: STRING_8
s32 := Void
s8 := s32 -- We get a call on Void target here, since it is equivalent to s8 := s32.as_string_8

Personally I usually write the explicit conversion `.as_string_8' to avoid this kind of error.

Hopefully in Void-safe mode the compiler reports this as an error. But in non void-safe mode, I find this case pretty annoying.

However, the user can still check all callers of `STRING_32.as_string_8' using the feature relation tool.

I am wondering, what about removing also the conversion from STRING_8 to STRING_32? I understand from STRING_32 to STRING_8 the "content" will be "converted" to STRING_8, so we are potentially loosing information, but with the conversion from STRING_8 to STRING_32, we still have the "call on void target" issue, but not that critical thanks to Void safety.

In void safe mode, it is not

manus_eiffel's picture

In void safe mode, it is not allowed to convert if the source is not attached, therefore it is not an issue.

To have a good idea of the

manus_eiffel's picture

To have a good idea of the impact of such a removal, on EiffelStudio itself (6300 classes and about 2M lines of code) it gives a total of about 578 errors.

Syndicate content