The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Nullable type support in the community preview

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eric Gunnerson

Posts: 1006
Nickname: ericgu
Registered: Aug, 2003

Eric Gunnerson is a program manager on the Visual C# team
Nullable type support in the community preview Posted: Jun 1, 2004 10:34 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Eric Gunnerson.
Original Post: Nullable type support in the community preview
Feed Title: Eric Gunnerson's C# Compendium
Feed URL: /msdnerror.htm?aspxerrorpath=/ericgu/Rss.aspx
Feed Description: Eric comments on C#, programming and dotnet in general, and the aerodynamic characteristics of the red-nosed flying squirrel of the Lesser Antilles
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Eric Gunnerson
Latest Posts From Eric Gunnerson's C# Compendium

Advertisement

One reader commented that nullable types don't seem to fully work in the community preview drop.

He's correct, and I apologize for not making that clearer in my post.

The time constraints of the community preview prevented us from getting all the nullable support in the compiler, but it will be there in the upcoming beta.

For the community preview, the following things work:

  • You can write a nullable type using the “?“ syntax
  • There are conversions from T to T?
  • You can use HasValue and Value on the type.

The following things don't work:

  • Adding two nullable ints together (or any other operations that operate on the underlying type)
  • Comparing a nullable instance to the literal “null“
  • Using the ?? operator
  • Converting from S? to T? if a conversion from S to T exists.

Read: Nullable type support in the community preview

Topic: Paul Vick discusses the question that just won't go away... VB or C#? Previous Topic   Next Topic Topic: TechEd: Hands On Lab Manuals

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use