-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersBugLanguage-C#Resolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implementedVerified
Milestone
Description
using System;
class Foo {
void M(object[] xs) {
IFormattable s1 = $"{null}"; // Create("{0}", new object[1])
IFormattable s2 = $"{xs}"; // Create("{0}", new object[] { xs })
dynamic nil = null, ys = xs;
IFormattable d1 = $"{nil}"; // Create("{0}", (object[]) null)
IFormattable d2 = $"{ys}"; // Create("{0}", (object[]) xs)
}
}
namespace System.Runtime.CompilerServices {
public static class FormattableStringFactory {
public static IFormattable Create(string format, params object[] xs) => null;
}
}Can this be solved with current dynamic codegen? Maybe with some flags...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersBugLanguage-C#Resolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implementedVerified