This project is read-only.

Discussions under C# Language Design

Please see the language topics for design notes and discussion on potential new features, the APIs topic for questions and discussion on all API layers, and the General topic for all else.  As the need arises over time, coordinators can create new topics.

See the Questions, Comments, and Feedback page to see where the team discusses features, how to file bugs, etc.

Null-propagating operator ?. in Expression Trees: spec v1

first post: Olmo wrote: This Specification discusses the support of ?. in expression trees ...

latest post: JanKucera wrote: In terms of progress, things moved to GitHub: https://github.com/do...

Suffix for byte type

first post: MasuqaT wrote: Byte type is used for colors(picture, graphics etc.) Byte don't ha...

latest post: JanKucera wrote: Good for you, though I would suggest filing that at https://github....

non-nullable reference types (the one billion $ mistake)

first post: Olmo wrote: NOTE: Since this conversation has become really log, I've added a c...

latest post: PauloMorgado wrote: Discussions moved to https://github.com/dotnet/roslyn/issues?q=is%3...

Primary Constructors

first post: CharlesJenkins wrote: C# 6.0 didn't ship having the proposed primary constructors--I imag...

latest post: PauloMorgado wrote: These discussions have moved to https://github.com/dotnet/roslyn/is...

applying CodeFix then save to disk

first post: parsavali wrote: Hello, I have a question. Based on the info on this page ("https...

latest post: PauloMorgado wrote: These discussions have moved to https://stackoverflow.com/

Generics usage in extensions methods

first post: PavelBNovikov wrote: Hi all! I encountered interesting issue within types handling in C...

latest post: Pilchie wrote: Hi, note that Roslyn has moved to Github (http://github.com/dotnet/...

extend object initializer syntax to arbitrary expressions

first post: spongman wrote: i love c#'s object initializers, they save typing, but more importa...

latest post: PauloMorgado wrote: Discussions have moved to https://github.com/dotnet/rolslyn/ and th...

PrimitiveValueType and NumericValueType base classes

first post: Ultrahead wrote: The following proposal is based on point 5 in this article: http://...

latest post: Ultrahead wrote: Yes, thanks. It's actually here: https://github.com/dotnet/roslyn...

params to Dictionary<string,T>

first post: cordasfilip wrote: params to Dictionary<string,T> Here is something that I thought tha...

latest post: PauloMorgado wrote: Discussions have moved to: https://github.com/dotnet/roslyn/issues

Changes to the language feature set

first post: madst wrote: Hi all, As we enter the final stage in our long quest to renew th...

latest post: Halo_Four wrote: Just to note, Roslyn has been moved to GitHub and all conversations...

Obsolete thread. Please delete.

first post: xor88 wrote: Obsolete.

latest post: xor88 wrote: Obsolete.

File scoped namespaces.

first post: Micah071381 wrote: Problem: Every file in a project that utilizes namespacing contain...

latest post: PauloMorgado wrote: Discussion have moved to https://github.com/dotnet/roslyn/

Expand Caller Info Attributes

first post: Halo_Four wrote: The current batch of caller info attributes supported in C# 5.0 and...

latest post: Halo_Four wrote: Note that all discussions have moved over to Github. I reposted th...

Case fall through should be allowed

first post: dotnetchris wrote: C# should really allow proper case fall through. There is no reason...

latest post: dotnetchris wrote: Moved to https://github.com/dotnet/roslyn/issues/1426

String Interpolation for C# (v2)

first post: nmgafter wrote: String Interpolation for C# (v2) An interpolated string is a way to...

latest post: nmgafter wrote: We are no longer using codeplex for Roslyn. Please take the discuss...

answered by: nmgafter wrote: This draft reflects some proposed changes. __It is not yet the cons...

Marking a method as one that throws Exceptions

first post: shivkmr003 wrote: Frequently we have code such as the below static int GetSom...

latest post: shivkmr003 wrote: Do that today. There are many cases where this is not the best appr...

With

first post: BadKid wrote: About the only feature I like in VB could be used in C#, and it wou...

latest post: PauloMorgado wrote: The discussions have moved to https://github.com/dotnet/roslyn/

Extending the null-coalescing operator to support throwing exceptions

first post: shivkmr003 wrote: Here is some example code that I hope will explain the use case ...

latest post: svick wrote: 1. Roslyn has moved to [GitHub](https://github.com/dotnet/roslyn), ...

string interpolation: proposed design changes

first post: nmgafter wrote: String Interpolation for C# An interpolated string is a way to cons...

latest post: nmgafter wrote: The Roslyn team no longer uses this site. Your comments are most we...

answered by: nmgafter wrote: String Interpolation for C# An interpolated string is a way to cons...

Using alias for generic types

first post: LeonardoTaglialeg wrote: It would be nice to have the possibility of writing things like: us...

latest post: nmgafter wrote: The Roslyn team no longer uses this site. Your comments are most we...

F# Type Providers in C#?

first post: Ncage1974 wrote: I've always yearned for type providers in c#/vb.net since they were...

latest post: nmgafter wrote: The Roslyn team no longer uses this site. Your comments are most we...

Static interface members

first post: Flowster wrote: It would be really nice to have static Interface members. This woul...

latest post: nmgafter wrote: The Roslyn team no longer uses this site. Your comments are most we...

"using static" - why not "with"?

first post: Vincent3000 wrote: Hi, guys! I'm interesting, who and why offered idea for static impo...

latest post: nmgafter wrote: We are no longer using codeplex for Roslyn. If you'd like the Rosly...

Enum and Delegate as Generic Type Constraints Proposal

first post: Halo_Four wrote: Enum and Delegate Generic Type Constraints Proposal I'm going to tr...

latest post: paulhickman wrote: I just encountered a real world use case: My generic class uses th...

Extension properties

first post: atodorow wrote: Extension methods allow us to add methods to existing types without...

latest post: supercat wrote: Ideally, when name collisions occur between extension methods and c...

generate reference to symbol

first post: tsadigov wrote: I am working on a refactoring. It generates a new class and I want ...

is the compiler portable

first post: mutasim wrote: I was wondering that if the compiler portable , as this compiler do...

Member visiblity in XML Doc

first post: MichaelKetting wrote: I've just started playing with VS14 and noticed that C# 6.0 is now ...

latest post: MichaelKetting wrote: This issue has now been resolved according to https://github.com/do...

answered by: MichaelKetting wrote: This issue has now been resolved according to https://github.com/do...

[Suggestion] Don't require "async" keyword for the methods with "awaits" in the body

first post: artelk wrote: This is misleading. This looks like a part of method signature but ...

latest post: artelk wrote: **lwischik wrote:** > We didn't pick this design to be intentionall...

String Interpolation: Will interpolation with pluralization be handled?

first post: jgill wrote: It was pointed out to me that C# 6.0 is headed towards using an int...

latest post: Halo_Four wrote: **lwischik wrote:** > I think that the resource editor (.resx files...

Java-like virtual extension methods/default interface implementations, aka traits or (ruby-like) mixins

first post: FabianSchmied wrote: I've just posted a new language feature request to UserVoide about ...

latest post: FabianSchmied wrote: I've created a copy of this discussion at GitHub, now that Roslyn h...

Automatic Interface

first post: MaJaHa95 wrote: I don't know whether this is more of a language or IDE feature, but...

Parameter name aliases

first post: TheDeeds wrote: Consider the following scenario: public abstract class CompilerBa...

latest post: Halo_Four wrote: **svick wrote:** > @supercat: Yeah, fixing typos (or the like) seem...

Generic condition "where : new()" with parameter

first post: Flowster wrote: I had this many times where i would new up an instancen of a generi...

latest post: supercat wrote: **stassultanov wrote:** > Indeed there is a lot of work to be done....

Value assignment try-catch

first post: kolozsaron wrote: As a shortcut of value assignment construct with try-catch block: i...

latest post: mdanes wrote: **supercat wrote:** > and for the Add method (or any other) to call...

String Interpolation suggestion: Names in the FormattableString

first post: ashmind wrote: As far as I understand, current proposed design for the Formattable...

latest post: nmgafter wrote: We can always do this later. This release is pretty much in the bag...

Referencing static class with self

first post: zxey wrote: Hello I think it would be nice if you could reference static class ...

latest post: mdanes wrote: **PauloMorgado wrote:** > How would that for `struct`s? Another key...

Multivariable declaration

first post: weitzhandler wrote: First of all, this is a feature that exists in most C style languag...

C# 6 Interactive Playground

first post: tenor wrote: Hi all, I've upgraded CSharpPad.com to use the latest Roslyn bits...

latest post: Avi_Avni wrote: Why not open source?

GetValueOrThrow for Nullable Types

first post: punitganshani wrote: Most often for nullable types we end up writing code like int? nume...

latest post: PauloMorgado wrote: **punitganshani wrote:** > Most often for nullable types we end up ...

C# Design Notes for Sep 3, 2014

first post: madst wrote: C# Design Notes for Sep 3, 2014 Notes are archived here. Quote of...

latest post: fmilando wrote: Love all these new features and there's one more that, in my opinio...

Is there a way to distinguish between array and indexer calls ?

first post: macpak wrote: Hi, I am working on some analyzers and I need to check indexers c...

Global type aliases (with generics)

first post: artelk wrote: I think it would be great if C# supported two additional features: ...

Is an expression-bodied function both an Expression<Func<..>> and Func<..>?

first post: jbakic wrote: Hello everyone! While using Entity Framework, in particular its L...

latest post: Mariuszz wrote: I like the idea that compiler could generate Func and Expression> f...

Exception in App Domain usage since VS2015

first post: jogibear9988 wrote: I got the following Exception A first chance exception of type '...

latest post: jogibear9988 wrote: I fixed it be creating a static method of the Lambda! But don't kno...

Proxy support to allow easy composition of types

first post: mortoray wrote: It would be very helpful, and improve code maintenance, to have a w...

ReportDiagnostic and ContainsDiagnostics

first post: akarpus wrote: I'm using the latest Roslyn and VS15 preview bits. I have written...

latest post: jmarolf wrote: [ContainsDiagnostics](http://source.roslyn.codeplex.com/#Microsoft....

Find specific invocation

first post: DanDanR wrote: Hey boys and girls! I've got a specific method invocation similar ...

latest post: jmarolf wrote: What you want to do is get the method symbol for the method in ques...

Strange C# Compiler Error

first post: albus95 wrote: I could have found some strange think. I'm working on some code for...

latest post: albus95 wrote: I'm stupid I don't know why I write struct here. Thanks. Also thank...

Dictionary Initializers - Real LIfe Usage

first post: Grokys wrote: Hello, Just thought you might want to know how the new C# 6 featu...

latest post: MgSam wrote: Agree; this is a cool project. Best of luck to you with it! I'd lov...

Create the output assembly when there are compilation errors

first post: erikkallen wrote: When refactoring a large codebase, you will occasionally get into s...

latest post: erikkallen wrote: **Halo_Four wrote:** > It is interesting conceptually. It seems li...

answered by: nmgafter wrote: erikkallen wrote: My idea is to create a compiler switch -errors-a...

Pure values

first post: MariusUtheim wrote: I propose a way of explicitly declaring methods and classes as pure...

latest post: supercat wrote: If a structure semantically represents a fixed-sized collection of ...

Nullable<T> for reference types

first post: GabrielHorvath wrote: Because Nullable<T> only supports value types, some teams write the...

latest post: wekempf wrote: ``` if (myDict.TryGetValue(myKey, out TheResultType result)) { ... ...

Null-propagating operator ?.

first post: lwischik wrote: Null propagating operator ?. The ?. operator is the second-highest ...

latest post: supercat wrote: **mirhagk wrote:** > You can already do something similar with exte...

answered by: lwischik wrote: Thank you for all the discussion, everyone. The C# Language Design ...

Template Functions & Template Masks

first post: AdamSpeight2008 wrote: Template Functions Template Functions will allow you return the exp...

latest post: AdamSpeight2008 wrote: Found a way to do Template Functions (kind of) in C#6 via String In...

Pop Linq Extension

first post: dcumin39 wrote: When we are iterating over a list we sometimes like to remove the i...

latest post: Halo_Four wrote: **kekekeks wrote:** > I'm not sure that BCL team will be accepting ...

Exception filtering syntax

first post: danwyand wrote: I'm a little late to the party (especially since the feature is mar...

latest post: supercat wrote: **danwyand wrote:** > For "when," I think its best to avoid adding ...

Limited return-type overloading

first post: supercat wrote: C# requires that method overloads be determined entirely by argumen...

C# Language Design Notes for Aug 27, 2014 (Part II)

first post: madst wrote: This is Part II. Part I is here. Generated parameterless constructo...

latest post: ArashSahebolamri wrote: Wouldn't such a feature be confusing and subject to abuse? Isn't ha...

Using static changes

first post: MgSam wrote: I just finished reading Mads' summary on C# 6.0 (nice article by th...

C#: Index initializers in constructors, too?

first post: SetTrend wrote: I prefer to initialize objects through using constructors. This'll ...

latest post: SetTrend wrote: Well, basically JSObject is nothing but a collection of Dictionarie...

Valid parent syntax of labmda expression

first post: PavelBNovikov wrote: Hi everybody. I'm writing "yet another" c#-to-javascript translator...

latest post: PavelBNovikov wrote: Thanks a lot, Anthony! It really simplifies the things. I should cr...

answered by: ADGreen wrote: Hi Pavel, There are several approaches one could use to infer the ...

Enums Constraints For generics

first post: Ultrahead wrote: This has been proposed in uservoice: https://visualstudio.uservoice...

latest post: Halo_Four wrote: I've posted a simple proposal at the following thread: [Enum and D...

New Language Features in C# 6

first post: madst wrote: Hi all, Today we release the Visual Studio 2015 Preview. I've upd...

latest post: nmgafter wrote: jaliyaudagedara wrote: It's too bad not to include Declaration Exp...

Using multiple analyzers/rules in Roslyn

first post: waseemakhtar wrote: I have done a lot of searching around before asking this question. ...

latest post: PauloMorgado wrote: **waseemakhtar wrote:** > The .iso from this link: > > http://www....

Allowing comparisons with less code

first post: Ultrahead wrote: I don't know if this has been proposed before, but many times we ha...

latest post: PauloMorgado wrote: nmgafter wrote: Something like this might fit in very nicely with ...

Argument validation

first post: MsdnDev wrote: Hello, Quite often in the code we do argument validation with plen...

latest post: Halo_Four wrote: I doubt you'll see dedicated keywords for validation. The number o...

Precompiled LINQ Expression delegates by compiler

first post: mspring wrote: I try to refactor any occurence of repeated LINQ code into reusable...

latest post: Olmo wrote: I really like your idea. We currenlty have a [Evaluate](http://www....

Ability to use operators as conditions for generics

first post: ruwancw wrote: Is it possible to enable checking implementation of operators as co...

latest post: Ultrahead wrote: Please read this discussion: https://roslyn.codeplex.com/discussion...

Method name as matching custom attribute application - helps to work with attribute based frameworks (e.g. MSTest)

first post: asdandRizzo wrote: Right now I write next in MSTest: [TestInitialize] ...

latest post: nmgafter wrote: A language feature of this complexity just to avoid typing a single...

Data Classes

first post: tzachs wrote: With the new language features removing boilerplate code, I thought...

latest post: Halo_Four wrote: Check out the following thread and linked proposal doc: [Draft spe...

nameof operator - v5

first post: lwischik wrote: nameof operator: spec v5 The nameof(.) operator has the form nameof...

latest post: PauloMorgado wrote: **lwischik wrote:** > Another TODO item: > https://roslyn.codeplex....

Delegate and enum type constraints support

first post: afsherman wrote: CLR can declare System.Enum and System.Delegate as type constraints...

latest post: BachratyGergely wrote: "really, really, __really__ unlikely " See here: https://roslyn.cod...

answered by: BachratyGergely wrote: "really, really, __really__ unlikely " See here: https://roslyn.cod...

Indirect function call.

first post: Newbiek wrote: Hi Everybody, In IL its possible to call a function indirect with ...

latest post: afsherman wrote: I think what you need something like Visual Studio on UserVoice, bu...

Code Contracts

first post: davedev wrote: Hi, Are there any plans to add Code Contract keywords to C#? (Pr...

latest post: Knat wrote: I think it's the domain of metaprogramming. Suppose you have invent...

Constants at property level

first post: mspring wrote: I always define constants as local as possible. So when I have a co...

latest post: mspring wrote: Without duplication there is no chance for a typo.

LambdaExpression created from Lambda different from c#5 compiler

first post: jogibear9988 wrote: If I create a Lambda like this: () => ((Byte) 0) .ToString() ...

latest post: Suchiman wrote: Have a look at https://roslyn.codeplex.com/workitem/246 this was th...

answered by: jogibear9988 wrote: https://roslyn.codeplex.com/workitem/264

Possibility to provide operators in interface

first post: msedi wrote: Hello, I'm totally missing the feature that I can create operator...

latest post: supercat wrote: Are there factors that preclude having operators be usable on inter...

async/await, IObservable, and yield return

first post: TheGrandUser wrote: This will likely be a complex feature, but I would like to have the...

latest post: agat50 wrote: Yes, thanks, a little tricky syntax but works exactly as needed.

What if I want to pass something into an attribute?

first post: Mahlzeit wrote: I think attributes are way too limiting. As a 3rd party developer I...

latest post: Mahlzeit wrote: Hm I guess that would be what my suggestion amounts to. The attribu...

Breakpoint Diagnostics

first post: AdamSpeight2008 wrote: This topic is to further a discussion on another thread, as not to ...

latest post: nmgafter wrote: **AdamSpeight2008 wrote:** > This topic is to further a discussion ...

Attributes for anonymous and state machine methods

first post: darkman666 wrote: With async/await and LINQ anonymous methods and state machine metho...

latest post: nmgafter wrote: We currently make a point to copy the DebuggerHidden attribute, but...

if false keyword, alternative to bang ! operators

first post: dotnetchris wrote: I find the bang operator ! to be extremely easy to miss in both cre...

latest post: bondsbw wrote: How about simply ``` C# if !(expression) ``` So I could do ``` C...

Implication Operator

first post: davedev wrote: Any consideration for an implication operator? How about using the ...

latest post: bondsbw wrote: @davedev, I'm not sure I would like the ternary without else. Some...

Sorter syntax for lambda expression with just one parameter

first post: Olmo wrote: Most of the usages of lambdas take just one parameter, why not make...

latest post: arek_bal wrote: Olmo wrote: arek_bal wrote: People.Select($.DoIt(String.Concat($0...

How would I make more of this analysis Roslyn and less text parsing?

first post: ImaginaryDev wrote: F# version C# version it does what I want but seems more of it sh...

latest post: jmarolf wrote: Which version of visual studio do you have installed? To use the s...

Remove requirement for semicolon (;) at end of line

first post: codefox wrote: You did that with TypeScript and this is great. For me putting semi...

latest post: supercat wrote: **Halo_Four wrote:** > Doable, but I think that the compiler would ...

Implementation of auto properties with traits

first post: VladD wrote: Dear all, this is a spin-off thread of this discussion. I think def...

Getter and Setter delegates for Auto Properties

first post: lesliemarshall wrote: When building applications using WPF and Databinding very often we ...

latest post: Halo_Four wrote: **KathleenDollard wrote:** > Yes, these are two of the problems. > ...

Roslyn Diagnostic with Code Fix: Analyzing Web.config file

first post: mhidalgo wrote: Hi guys, I've been playing with Roslyn Diagnostic with Code Fix f...

latest post: JesperTreetop wrote: Roslyn diagnostics are being loaded by the C# and VB compilers and ...

Add single quote as string delimiter to allow unquoted double quotes

first post: dotnetchris wrote: There are many times you wish to include text with double quotes in...

latest post: supercat wrote: **dotnetchris wrote:** > Seeing as both quotes and double quotes ar...

Property reusability

first post: higty wrote: All we frequently implement this. public Person { private Strin...

latest post: higty wrote: Hi Olmo. We talk same issue but different solution. So, I create n...

Lazy getter

first post: vripoll wrote: Hi everyone, In numerous cases, we have the following implementati...

latest post: Halo_Four wrote: Just going to poke this thread with [this ongoing discussion](https...

nameof spec v4

first post: lwischik wrote: This is v4 of the spec for the "nameof" operator. [v1, v2, v3). v1...

latest post: supercat wrote: **Halo_Four wrote:** > I agree that there is value in being able to...

answered by: lwischik wrote: I've started a new thread with v5 of the nameof spec. Let's move co...

Better support of attributes in C#

first post: dotnetchris wrote: Suppose I want to use a marker interface on a class if(foo is IMark...

latest post: supercat wrote: **dotnetchris wrote:** > One is the optimized path, the other can u...

nameof: proposed design changes

first post: lwischik wrote: We've been reconsidering some details about the "nameof" operator. ...

latest post: lwischik wrote: Based on feedback, I've produced v4 of the "nameof" spec. I started...

answered by: lwischik wrote: Based on feedback, I've produced v4 of the "nameof" spec. I started...

String interpolation

first post: lwischik wrote: String interpolation String interpolation is one of the top ten req...

latest post: nmgafter wrote: Please see https://roslyn.codeplex.com/discussions/570292 for a rev...

answered by: nmgafter wrote: Please see https://roslyn.codeplex.com/discussions/570292 for a rev...

Filed Ref's

first post: JesInc28 wrote: Often we need fast dynamic read/write to field of Custom Object. ...

latest post: svick wrote: supercat wrote: TheMethod(new ReadWritePropertyWrapper( ()=>retu...

C#/VB Language Design Meeting notes - 2014-10-01

first post: lwischik wrote: There were two agenda items... Assignment to readonly autoprops in...

latest post: lwischik wrote: **supercat wrote:** > An `out` parameter is really a `ref` paramete...

Avoiding Reflection By Assuming Generic Arguments to be of Type Object

first post: MaJaHa95 wrote: I work a lot with generic parameters and reflection, and it would b...

latest post: angocke wrote: **jasonmalinowski wrote:** > Looking at the original question, it'...