Well, today compiier generates anonymous types as generic AND sealed classes. A paradoxal combination since specialization of a generic class is a kind of inheritance, isn't?
So you can check for this:
1. Is this a generic type?
Yes => 2) is its definition sealed && not public?
Yes => 3) is its definition has CompilerGeneratedAttribute attribute?
I guess, if these 3 criteria are true together, we have an anonymous type...
Well... There is a problem with ANY of methods described - they are use aspects that may change in next versions of .NET and it will be so until Microsoft will add IsAnonymous boolean property to Type class. Hope it will happen before we all die...
Until that day, it can be checked like so:

There are cases where this does not hold true. I'm not sure of all cases where this fails, but one example is where a lambda expression is used within a protected concrete method of an abstract class with generic parameters. I'm sure there are simpler cases that would also fail.
–
NathanMay 6 '14 at 21:32

Never seen this fail and I believe this is used in SimpleData for Anonymous detection. Please provide a code example where this actually fails.
–
DalSoftMay 14 '14 at 18:40