Bug 12490 - Cast warnings with literals
Summary: Cast warnings with literals
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-05-31 11:32 UTC by Mikayla Hutchinson [MSFT]
Modified: 2014-01-27 06:01 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Mikayla Hutchinson [MSFT] 2013-05-31 11:32:45 UTC
I'm getting pointless cast warnings when assigning literals. An implicit conversion fo the types does not exist but the compiler automatically converts literals in these cases AFAIK.

uint t;
t = 6;

float t;
t = 6.0;
Comment 1 Mike Krüger 2013-06-07 01:26:56 UTC
fixed.
Comment 2 Sadik Ali 2014-01-24 10:11:32 UTC
I have checked this issue, but I getting warning for float value.

Refer screen cast: http://www.screencast.com/t/aQ2LxamoQ

Please let me know if this warning is issue.

Checked With:

All Mac

Environment info:
Xamarin Studio
Version 4.2.3 (build 154)
Build Information
Release ID: 402030154
Git revision: 4dca4a28d7ecc2c4df8a4d58e74b8902d0283b53
Xamarin addins: cc120a6f639fa6649aa4d23a0f0e7c5701134047

XA 4.13.0.36

Xamarin.iOS
Version: 7.0.7.64 
Hash: 094bb4e
Comment 3 Mike Krüger 2014-01-24 11:45:37 UTC
y, but 

float t;
t = 6.0;


isn't correct - the IDE should warn on that since it doesn't compile. The bug was in :

uint t;
t = 6;

int->uint conversion does the compiler.
Comment 4 Sadik Ali 2014-01-27 06:01:49 UTC
As per comment 3,I mark this as verified.