Diego B. FernandezDiego B. Fernandez

  1. 4,928 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      198 comments  ·  Visual Studio » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →

      We are seriously considering this feature for C# and VB, and will be prototyping it in coming months. Syntax in C# would be

      e?.x // member access
      e?.M(…) // method invocation
      e?[…] // indexing

      Semantically this will be similar to

      (e == null) ? null : e.x

      etc., except that e will only be evaluated once of course.

      If the type of e.x (etc) is a non-nullable value type S, then the type of e?.x is S?. Otherwise the type of e?.x is the same as that of e.×. If we can’t tell whether the type is a non-nullable value type (because it is a type parameter without sufficient constraints) we’ll probably give a compile-time error.

      Thanks for all the great comments!

      Mads Torgersen
      C# Language PM

      Diego B. FernandezDiego B. Fernandez gave this 1 vote  · 
    • 1,500 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        53 comments  ·  Visual Studio » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
        Diego B. FernandezDiego B. Fernandez gave this 3 votes  · 
      • 1,329 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          50 comments  ·  Visual Studio » Team Foundation Server  ·  Flag idea as inappropriate…  ·  Admin →
          Diego B. FernandezDiego B. Fernandez commented  ·   ·  Delete…

          Awesome
          Hope it will fill my need for versioning + ALM

          Diego B. FernandezDiego B. Fernandez gave this 1 vote  · 

        Feedback and Knowledge Base