var compilation = CreateCompilationWithMscorlib(source,
references: new[] { ValueTupleRef });
compilation.VerifyEmitDiagnostics(
// (7,24): error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
// (9,22): error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
BC37267: Predefined type 'ValueTuple(Of ,)' is not defined or imported.
Dim t as (Integer, Integer)
~~~~~~~~~~~~~~~~~~
BC37267: Predefined type 'ValueTuple(Of ,)' is not defined or imported.
Dim t as (Integer, Integer)
~~~~~~~~~~~~~~~~~~
BC37267: Predefined type 'ValueTuple(Of ,)' is not defined or imported.
Dim t1 as (A As Integer, B As Integer)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BC37267: Predefined type 'ValueTuple(Of ,)' is not defined or imported.
Dim t1 as (A As Integer, B As Integer)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BC37268: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference?
Dim t1 as (A As Integer, B As Integer)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
@@ -4377,9 +4371,6 @@ BC37267: Predefined type 'ValueTuple(Of )' is not defined or imported.
BC37267: Predefined type 'ValueTuple(Of ,,,,,,,)' is not defined or imported.
Dim x As (Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer) = ("Alice", 2, 3, 4, 5, 6, 7, 8)
Dim comp = CreateCompilationWithMscorlibAndVBRuntime(
<compilation>
<file name="a.vb">
Imports System
Imports System.Collections.Generic
Public Class C
Iterator Function Test() As IEnumerable(Of (integer, integer))
yield (1, 2)
End Function
End Class
</file>
</compilation>, additionalRefs:={ValueTupleRef})
comp.AssertTheseEmitDiagnostics(
<errors>
BC30652: Reference required to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' containing the type 'ValueType'. Add one to your project.
Iterator Function Test() As IEnumerable(Of (integer, integer))
~~~~~~~~~~~~~~~~~~
BC30652: Reference required to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' containing the type 'ValueType'. Add one to your project.