Back

Misplacement of <MarshalAs> attribute to return value

From C# to VB, if I declare a simple function with the "MarshalAs" attribute in the return value, the VB code will have the "MarshalAs" attribute misplaced, as before the function declaration instead of just before the return value type.

For example:
C# code

[return: MarshalAs(UnmanagedType.U4)]
int MyFunction(int myInt);

translate to this VB code

<MarshalAs(UnmanagedType.U4)>
Private Function MyFunction(ByVal myInt As Integer) As Integer

but the correct translation is:

Private Function MyFunction(ByVal myInt As Integer) As <MarshalAs(UnmanagedType.U4)> Integer
» Post Comment

Comments (0)

 
No comments, yet. Be the first!

Post Comment

Your Comment :
Commenting is disabled when the portal is unlicensed.
Select...