You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Affected Branch:
Affected Build: 15.1
Affected Product Language: VB only
Steps to reproduce:
Launch VS version 15.1
Create a UWP VB project, set platform target version to RS2
Open MainPage.xaml
Add inside the root Grid
Expected:
You get a min target version incompatible warning
Actual:
For VB project, you don't see this warning. This scenario works fine on C# and C++ UWP projects.
The root cause is we get the ContractVersionAttribute from a ITypeSymbol, and then get the apiContract name and version from the attributeData's ConstructorArguments. This works as expected for C# and C++ projects, but for VB, the ConstructorArguments are always empty.
This bug is blocking a new XAML feature for RS2 - warn about types and properties not available in the target platform minimum version supported by the project.
The text was updated successfully, but these errors were encountered:
It appears the problem is in Private Function PEModuleSymbol.GetWellKnownType(type As WellKnownType, Optional careAboutAmbiguity As Boolean = True) As NamedTypeSymbol
The following code doesn't take into account the fact that currResult could be the same type as referencedAssemblyResult if the type was forwarded. Interestingly, C# compiler handles this properly in private NamedTypeSymbol PEModuleSymbol.GetTypeSymbolForWellKnownType(WellKnownType type)
Dim currResult As NamedTypeSymbol = assembly.LookupTopLevelMetadataType(emittedName, digThroughForwardedTypes:=True)
If IsAcceptableSystemTypeSymbol(currResult) Then
If referencedAssemblyResult Is Nothing Then
referencedAssemblyResult = currResult
Else
' CONSIDER: setting result to null will result in a MissingMetadataTypeSymbol
' being returned. Do we want to differentiate between no result and ambiguous
' results? There doesn't seem to be an existing error code for "duplicate well-
' known type".
If (careAboutAmbiguity) Then
referencedAssemblyResult = Nothing
End If
Exit For
End If
End If
AlekseyTs
added a commit
to AlekseyTs/roslyn
that referenced
this issue
Mar 28, 2017
Affected Branch:
Affected Build: 15.1
Affected Product Language: VB only
Steps to reproduce:
Expected:
You get a min target version incompatible warning
Actual:
For VB project, you don't see this warning. This scenario works fine on C# and C++ UWP projects.
The root cause is we get the ContractVersionAttribute from a ITypeSymbol, and then get the apiContract name and version from the attributeData's ConstructorArguments. This works as expected for C# and C++ projects, but for VB, the ConstructorArguments are always empty.
This bug is blocking a new XAML feature for RS2 - warn about types and properties not available in the target platform minimum version supported by the project.
The text was updated successfully, but these errors were encountered: