Open
Description
If I use stack only type in my VB code, error BC30668 will block compilation. I'm using VS2017 15.6.7.
Steps to reproduce:
- Create a .NET Core VB Console project.
- Edit the .vbproj file, add
<LangVersion>Latest</LangVersion>
in<PropertyGroup>
. - Create a .NET Standard 2.0 C# class library.
- Create a new C# code file, and add
public ref struct StackOnlyType {}
in that .cs file. - Upgrade the C# project to 7.2 .
- In the VB console app, add reference to that C# project.
- Add
Dim errorType As StackOnlyType
toSub Main
. - Build the whole solution.
Expected behavior:
The code should compile, because I'm not trying to put a stack-only variable on the heap.
Actual behavior:
Error: BC30668 "Types with embedded references are not supported in this version of your compiler"