-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Port and test VB Information, DoubleType, DecimalType, Versioned #31252
Conversation
|
||
#Region " BACKWARDS COMPATIBILITY. These functions (IsNumeric, TypeName, SystemTypeName, VbTypeName) have been superceded by the versions in Versioned.vb " | ||
|
||
'WARNING WARNING WARNING WARNING WARNING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this warning can be removed (Everett = VS2003, Orcas = VS2005...)
Also the region markers can go - there is no need to record compat with VS2002. Also I notice that in MSDN, Versioned.IsNumeric is marked not to use, so maybe it's not so superseded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had never heard of the Versioned namespace. What appears to happen is that the VB compiler silently moves calls to Information.IsNumeric to Versioned.IsNumeric. So the Information variants exist for binary backwards compatibility (or calls from other languages).
|
||
#Region " BACKWARDS COMPATIBILITY " | ||
|
||
'WARNING WARNING WARNING WARNING WARNING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove all these compat warning comments and #region markers -- they are 15 years old at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Thanks for doing this @bbowyersmyth |
@OmarTawfik any other feedback? |
|
||
#Region " BACKWARDS COMPATIBILITY " | ||
|
||
'WARNING WARNING WARNING WARNING WARNING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another to remove - I would also remove #Region " BACKWARDS COMPATIBILITY "
@bbowyersmyth could you please rebase this one also? |
Public Shared Function ToDate(Value As String) As Date | ||
Dim parsedDate As Global.System.DateTime | ||
Const parseStyle As Global.System.Globalization.DateTimeStyles = | ||
Global.System.Globalization.DateTimeStyles.AllowWhiteSpaces Or | ||
Global.System.Globalization.DateTimeStyles.NoCurrentDateDefault | ||
Dim culture As Global.System.Globalization.CultureInfo = GetCultureInfo() | ||
Dim result As Boolean = Global.System.DateTime.TryParse(ToHalfwidthNumbers(Value, culture), culture, parseStyle, parsedDate) | ||
Dim result As Boolean = Global.System.DateTime.TryParse(ToHalfwidthNumbers(value, culture), culture, parseStyle, parsedDate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value [](start = 87, length = 5)
Unintended change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Changed the casing back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing!
left one comment.
@danmosemsft do we have a work item logged somewhere to compare the added public API surface to desktop? With all of these changes (specially with how sometimes editors automatically lowercase things that should not (like parameter names)) it might be a breaking change to ship them this way. |
@dotnet-bot test Linux arm release build |
@OmarTawfik feel free to open one but to me that is a necessary step before closing the matter tracking issue. It is very easy with our API tooling |
Thanks @bbowyersmyth |
…net/corefx#31252) * Port from referencesource * Cleanup and tests * Remove parameter name validation * Address PR feedback * Address PR feedback Commit migrated from dotnet/corefx@5f635b2
Contributes to https://github.com/dotnet/corefx/issues/31181
Partial port of Information.vb and Versioned.vb. Remaining functions do COM lookups which require extra attention.
Information.IsNumeric with char array bug recorded as a test case.