Would you be able to provide a short code sample that produces this error? I'm not able to get this warning to come up with the handful of scenarios that I tried.

By on 5/27/2009 4:46 AM ()

It's the strangest thing -- I can't reproduce it in a newly-created project, but the solution that I was working on prior to upgrading to the May CTP pops up this warning for a bunch of lines involving System.DateTime.

Even if I cut and paste an entire module from my old project into a new project, I don't get the warning.

I'll work on it some more and report back.

By on 5/27/2009 6:10 PM ()

I see what happened -- I had the warning level set to 4 in my old project. For new projects it defaults to 3.

I've had the paranoid habit of maxing out the warnings and code analysis for a while now, it's hard to break.

Anyway, with Warning Level = 4, here are a few examples:

let tm = System.DateTime.Today.AddDays(1.0)

let offset d m y (date:System.DateTime) =

date.AddDays(float d)

.AddMonths(m)

.AddYears(y)

let r (b:System.DateTime) (e:System.DateTime) = double (e - b).Days / 10.0

By on 5/27/2009 6:23 PM ()

You could turn off this particular warning and still keep your project at warning level 4:

1
#nowarn "52"
By on 5/28/2009 4:23 AM ()

This warning is "informational" and only shows when using warning level 4.

That said, there was an issue where it also showed when using #load on a file, which mistakenly defaulted to level 4 for the loaded file. You may be seeing that.

Kind regards

don

By on 5/27/2009 6:12 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper