This is a migrated thread and some comments may be shown as answers.

Error in TypeOf Expression in VB->C#

0 Answers 44 Views
Code Converter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aleksander
Top achievements
Rank 1
Aleksander asked on 05 Jul 2013, 07:49 AM
The following code produces the wrong C# code (if you convert back and forth you get a different meaning result):

If Not TypeOf tmp Is String Then
    ' yadayada
End If

The C# produced is 
if (!tmp is string) {
    // yadayada
}

Which probably doesn't even compile because you can't use ! on anything that could potentially be a string (might be mistaken about that though).
Tags
Code Converter
Asked by
Aleksander
Top achievements
Rank 1
Share this question
or