Welcome to MSDN Blogs Sign in | Join | Help

jaredpar's WebLog

Code, rants and ramblings of a programmer.

Syndication

News

Now Reading

Expert F#

What's a better book to read when learning F#?

Essential WPF

Thus far the best book I've read on WPF. Gets right down to working with WPF and the goals/history.

Purely Functional Data Structures

Reading this book makes me feel like I'm back in college. It will really get your mind going and is best read with a whiteboard handy.

Blog Roll

Eric Lippert
Dustin Campbell
Jon Skeet
Coding Horror
Brian McNamara
Brian Bondy
Hub FS
Full List

Coding Quiz: Anonymous Type Types

Question: How can you create a variable in VB which is typed as an anonymous type but not actually create an instance of that type?

Answer in comments. 

Note, doing this is not particularly useful it came about while I was playing around with a feature a few days ago.

Published Wednesday, August 01, 2007 11:34 AM by Jared Parsons

Filed under: , , ,

Comments

# re: Coding Quiz: Anonymous Type Types @ Wednesday, August 01, 2007 11:37 AM

Module Module1

   Function GetAtType(Of T)(ByVal f As Func(Of T)) As T

       Return Nothing

   End Function

   Sub Main()

       Dim x = GetAtType(Function() New With {.Name = "Name"})

   End Sub

End Module

Jared Parsons

# Casting to an Anonymous Type @ Monday, October 01, 2007 11:17 AM

This discussion is building upon a previous post on how to acquire an anonymous type ... type . 

jaredpar's WebLog

# Casting to an Anonymous Type @ Monday, October 01, 2007 11:22 AM

This discussion is building upon a previous post on how to acquire an anonymous type ... type . The next

jaredpar's WebLog

New Comments to this post are disabled
Page view tracker