jmon Well-Known Member Licensed User Longtime User Aug 14, 2015 #1 Hi, I recently got a list of annoying warnings in my log. Types do not match. (Warning #22) Click to expand... when I write something like that: Code: Copy Dim Id As Int Dim Text as JavaObject = "My Text" Id = Text.RunMethod("hashCode", Null) What I expected, was no warning, because RunMethod returns an object and I just want to convert this object to int, because hashCode returns an int. It's not really a big issue, but I just get my logs flooded with a list of type Mismatch. I'm not sure, but it could have appeared when I updated to 3.50. Thank you for your amazing work. Jmon.
Hi, I recently got a list of annoying warnings in my log. Types do not match. (Warning #22) Click to expand... when I write something like that: Code: Copy Dim Id As Int Dim Text as JavaObject = "My Text" Id = Text.RunMethod("hashCode", Null) What I expected, was no warning, because RunMethod returns an object and I just want to convert this object to int, because hashCode returns an int. It's not really a big issue, but I just get my logs flooded with a list of type Mismatch. I'm not sure, but it could have appeared when I updated to 3.50. Thank you for your amazing work. Jmon.
Erel B4X founder Staff member Licensed User Longtime User Aug 14, 2015 #2 The warning comes from this line: Code: Copy Dim Text As JavaObject = "My Text" Trying to convert a string to a different object is in many cases a programming error. In this case your code is correct. You should add 'ignore on this line.
The warning comes from this line: Code: Copy Dim Text As JavaObject = "My Text" Trying to convert a string to a different object is in many cases a programming error. In this case your code is correct. You should add 'ignore on this line.