Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This sound like a flawless approach, but internally the "settype" function is used for type conversion and instead here what happens:

Form ValueData TypeConverted ValueResult
text"int" or "float"0

Status
colourRed
titleFAILure

5.2int5

Status
colourRed
titleFAILure

5.2float5.2

Status
colourGreen
titlesuccess

5.0float5

Status
colourRed
titleFAILure

textstringtext

Status
colourGreen
titlesuccess

As it becomes clear from above conversion table the "settype" function silently transforms value to match expected data type and it doesn't consider it as conversion failure, even when it technically is.

...

In "kFormatter::TypeCast" method, when value after calling "settype" method is changed (ignore fact, that data type is changed), then consider it as failed casing and return "false".

Related Discussions

Related Tasks

Jira Legacy
serverSystem Jira
serverId513b375f-8291-3313-9d9f-704c39b1f915
keyINP-1682