Module Creation

Provides expression classes for creating various types of object.

Import path

semmle.code.csharp.exprs.Creation

Imports

Callable

Provides Callable classes, which are things that can be called such as methods and operators.

Expr

Provides all expression classes.

Classes

AnonymousFunctionExpr

An anonymous function. Either a lambda expression (LambdaExpr) or an anonymous method expression (AnonymousMethodExpr).

AnonymousMethodExpr

An anonymous method expression, for example delegate (int x) { return x + 1; }.

AnonymousObjectCreation

An anonymous constructor call, for example new { First = x[0], Last = x[x.Length - 1] } on line 2 in

ArrayCreation

An array creation, for example new int[,] { {0, 1}, {2, 3}, {4, 5} }.

ArrayInitializer

An array initializer, for example { {0, 1}, {2, 3}, {4, 5} } in

CollectionInitializer

A collection initializer, for example { {0, "a"}, {1, "b"} } in

DelegateCreation

A delegate creation. Either an explicit delegate creation (ExplicitDelegateCreation) or an implicit delegate creation (ImplicitDelegateCreation).

ElementInitializer

An element initializer, for example the implicit call to Add(0, "a") on line 2 in

ExplicitDelegateCreation

An explicit delegate creation, for example new D(M) on line 6 in

ImplicitDelegateCreation

An implicit delegate creation, for example the access to M on line 6 in

LambdaExpr

A lambda expression, for example (int x) => x + 1.

MemberInitializer

A member initializer, for example X = 0 on line 6 in

ObjectCreation

A constructor call, for example new A() on line 3 in

ObjectInitializer

An object initializer, for example { X = 0, Y = 1 } on line 6 in

ObjectOrCollectionInitializer

Either an object initializer (ObjectInitializer) or a collection initializer (CollectionInitializer).