ResolveArrayCreation() public method

Resolves an array creation.
public ResolveArrayCreation ( IType elementType, ResolveResult sizeArguments, ResolveResult initializerElements = null ) : ArrayCreateResolveResult
elementType IType /// The array element type. /// Pass null to resolve an implicitly-typed array creation. ///
sizeArguments ResolveResult /// The size arguments. /// The length of this array will be used as the number of dimensions of the array type. /// The resolver may mutate this array to wrap elements in s! ///
initializerElements ResolveResult /// The initializer elements. May be null if no array initializer was specified. /// The resolver may mutate this array to wrap elements in s! ///
return ArrayCreateResolveResult
Exemplo n.º 1
0
 public override ResolveResult Resolve(CSharpResolver resolver)
 {
     ResolveResult[] elements = new ResolveResult[arrayElements.Count];
     for (int i = 0; i < elements.Length; i++) {
         elements[i] = arrayElements[i].Resolve(resolver);
     }
     int[] sizeArguments = { elements.Length };
     if (elementType != null) {
         return resolver.ResolveArrayCreation(elementType.Resolve(resolver.CurrentTypeResolveContext), sizeArguments, elements);
     } else {
         return resolver.ResolveArrayCreation(null, sizeArguments, elements);
     }
 }