return false;
}
+ var interpolated_string = expr as InterpolatedString;
+ if (interpolated_string != null) {
+ if (target_type == rc.Module.PredefinedTypes.IFormattable.TypeSpec || target_type == rc.Module.PredefinedTypes.FormattableString.TypeSpec)
+ return true;
+ }
+
return ImplicitStandardConversionExists (expr, target_type);
}
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
<UseVSHostingProcess>false</UseVSHostingProcess>\r
- <Commandlineparameters>../tests/test-936.cs -r:../tests/test-936-lib.dll</Commandlineparameters>\r
+ <Commandlineparameters>y.cs</Commandlineparameters>\r
</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
<DebugType>pdbonly</DebugType>\r
--- /dev/null
+using System;
+
+class Program
+{
+ static int counter;
+
+ static int Main ()
+ {
+ FormatPrint ($"Case {1}");
+ if (counter != 1)
+ return 1;
+
+ FormatPrint ($"Case {3}");
+ if (counter != 2)
+ return 2;
+
+ return 0;
+ }
+
+ static void FormatPrint (FormattableString message)
+ {
+ Console.WriteLine(message);
+ ++counter;
+ }
+}
</method>
</type>
</test>
+ <test name="test-interpolation-10.cs">
+ <type name="Program">
+ <method name="Int32 Main()" attrs="145">
+ <size>106</size>
+ </method>
+ <method name="Void FormatPrint(System.FormattableString)" attrs="145">
+ <size>20</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-iter-01.cs">
<type name="X">
<method name="Int32 Main()" attrs="150">