Beispiel #1
0
        private static NamedObjectType GetDeploymentReturnType(ResourceScopeType targetScope)
        {
            // Note: there are other properties which could be included here, but they allow you to break out of the bicep world.
            // We're going to omit them and only include what is truly necessary. If we get feature requests to expose more properties, we should discuss this further.
            // Properties such as 'template', 'templateHash', 'parameters' depend on the codegen, and feel like they could be fragile.
            IEnumerable <TypeProperty> properties = new []
            {
                new TypeProperty("name", LanguageConstants.String),
                new TypeProperty("properties", new NamedObjectType("properties", TypeSymbolValidationFlags.Default, new []
                {
                    new TypeProperty("templateLink", new NamedObjectType("properties", TypeSymbolValidationFlags.Default, new []
                    {
                        new TypeProperty("uri", LanguageConstants.String)
                    }, null))
                }, null)),
            };

            if (!targetScope.HasFlag(ResourceScopeType.ResourceGroupScope))
            {
                // deployments in the 'resourcegroup' scope do not have the 'location' property. All other scopes do.
                var locationProperty = new TypeProperty("location", LanguageConstants.String);
                properties = properties.Concat(locationProperty.AsEnumerable());
            }

            return(new NamedObjectType("deployment", TypeSymbolValidationFlags.Default, properties, null));
        }
Beispiel #2
0
        public static void EmitModuleScopeProperties(ResourceScopeType targetScope, ScopeData scopeData, ExpressionEmitter expressionEmitter)
        {
            switch (scopeData.RequestedScope)
            {
            case ResourceScopeType.TenantScope:
                expressionEmitter.EmitProperty("scope", new JTokenExpression("/"));
                return;

            case ResourceScopeType.ManagementGroupScope:
                if (scopeData.ManagementGroupNameProperty != null)
                {
                    // The template engine expects an unqualified resourceId for the management group scope if deploying at tenant scope
                    var useFullyQualifiedResourceId = targetScope != ResourceScopeType.TenantScope;
                    expressionEmitter.EmitProperty("scope", expressionEmitter.GetManagementGroupResourceId(scopeData.ManagementGroupNameProperty, useFullyQualifiedResourceId));
                }
                return;

            case ResourceScopeType.SubscriptionScope:
            case ResourceScopeType.ResourceGroupScope:
                if (scopeData.SubscriptionIdProperty != null)
                {
                    expressionEmitter.EmitProperty("subscriptionId", scopeData.SubscriptionIdProperty);
                }
                if (scopeData.ResourceGroupProperty != null)
                {
                    expressionEmitter.EmitProperty("resourceGroup", scopeData.ResourceGroupProperty);
                }
                return;

            default:
                throw new NotImplementedException($"Cannot format resourceId for scope {scopeData.RequestedScope}");
            }
        }
        public TypeSymbol GetDeclaredType(ResourceScopeType containingScope, SemanticModel moduleSemanticModel)
        {
            var paramTypeProperties = new List <TypeProperty>();

            foreach (var param in moduleSemanticModel.Root.ParameterDeclarations)
            {
                var typePropertyFlags = TypePropertyFlags.WriteOnly;
                if (SyntaxHelper.TryGetDefaultValue(param.DeclaringParameter) == null)
                {
                    // if there's no default value, it must be specified
                    typePropertyFlags |= TypePropertyFlags.Required;
                }

                paramTypeProperties.Add(new TypeProperty(param.Name, param.Type, typePropertyFlags));
            }

            var outputTypeProperties = new List <TypeProperty>();

            foreach (var output in moduleSemanticModel.Root.OutputDeclarations)
            {
                outputTypeProperties.Add(new TypeProperty(output.Name, output.Type, TypePropertyFlags.ReadOnly));
            }

            return(LanguageConstants.CreateModuleType(paramTypeProperties, outputTypeProperties, moduleSemanticModel.TargetScope, containingScope, "module"));
        }
Beispiel #4
0
        private static string GetSchema(ResourceScopeType targetScope)
        {
            if (targetScope.HasFlag(ResourceScopeType.TenantScope))
            {
                return("https://schema.management.azure.com/schemas/2019-08-01/tenantDeploymentTemplate.json#");
            }

            if (targetScope.HasFlag(ResourceScopeType.ManagementGroupScope))
            {
                return("https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#");
            }

            if (targetScope.HasFlag(ResourceScopeType.SubscriptionScope))
            {
                return("https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#");
            }

            return("https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#");
        }
Beispiel #5
0
        private static IEnumerable <FunctionOverload> GetAzOverloads(ResourceScopeType resourceScope)
        {
            foreach (var(functionOverload, allowedScopes) in GetScopeFunctions())
            {
                // we only include it if it's valid at all of the scopes that the template is valid at
                if (resourceScope == (resourceScope & allowedScopes))
                {
                    yield return(functionOverload);
                }
                // TODO: add banned function to explain why a given function isn't available
            }

            // TODO: Add schema for return type
            yield return(FunctionOverload.CreateFixed("deployment", LanguageConstants.Object));

            // TODO: Add schema for return type
            yield return(FunctionOverload.CreateFixed("environment", LanguageConstants.Object));

            // TODO: This is based on docs. Verify
            yield return(FunctionOverload.CreateWithVarArgs("resourceId", LanguageConstants.String, 2, LanguageConstants.String));

            yield return(FunctionOverload.CreateWithVarArgs("subscriptionResourceId", LanguageConstants.String, 2, LanguageConstants.String));

            yield return(FunctionOverload.CreateWithVarArgs("tenantResourceId", LanguageConstants.String, 2, LanguageConstants.String));

            yield return(FunctionOverload.CreateWithVarArgs("extensionResourceId", LanguageConstants.String, 3, LanguageConstants.String));

            // TODO: Not sure about return type
            yield return(new FunctionOverload("providers", LanguageConstants.Array, 1, 2, Enumerable.Repeat(LanguageConstants.String, 2), null));

            // TODO: return type is string[]
            yield return(new FunctionOverload("pickZones", LanguageConstants.Array, 3, 5, new[] { LanguageConstants.String, LanguageConstants.String, LanguageConstants.String, LanguageConstants.Int, LanguageConstants.Int }, null));

            // the use of FunctionPlacementConstraints.Resources prevents use of these functions anywhere where they can't be directly inlined into a resource body
            yield return(new FunctionOverload("reference", LanguageConstants.Object, 1, 3, Enumerable.Repeat(LanguageConstants.String, 3), null, FunctionFlags.RequiresInlining));

            yield return(new FunctionWildcardOverload("list*", LanguageConstants.Any, 2, 3, new[] { LanguageConstants.String, LanguageConstants.String, LanguageConstants.Object }, null, new Regex("^list[a-zA-Z]+"), FunctionFlags.RequiresInlining));
        }
Beispiel #6
0
 public AzNamespaceSymbol(ResourceScopeType resourceScope)
     : base("az", GetAzOverloads(resourceScope), ImmutableArray <BannedFunction> .Empty)
 {
 }
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="ResourceScopeType" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceScopeType.CreateFrom(sourceValue);
Beispiel #8
0
        private static IEnumerable <FunctionOverload> GetAzOverloads(ResourceScopeType resourceScope)
        {
            foreach (var(functionOverload, allowedScopes) in GetScopeFunctions())
            {
                // we only include it if it's valid at all of the scopes that the template is valid at
                if (resourceScope == (resourceScope & allowedScopes))
                {
                    yield return(functionOverload);
                }

                // TODO: add banned function to explain why a given function isn't available
            }

            // TODO: Add schema for return type
            yield return(new FunctionOverloadBuilder("deployment")
                         .WithReturnType(GetDeploymentReturnType(resourceScope))
                         .WithFixedParameters()
                         .Build());

            yield return(new FunctionOverloadBuilder("environment")
                         .WithReturnType(GetEnvironmentReturnType())
                         .WithFixedParameters()
                         .Build());

            // TODO: This is based on docs. Verify
            yield return(new FunctionOverloadBuilder("resourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithVariableParameters(2, LanguageConstants.String)
                         .Build());

            yield return(new FunctionOverloadBuilder("subscriptionResourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithVariableParameters(2, LanguageConstants.String)
                         .Build());

            yield return(new FunctionOverloadBuilder("tenantResourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithVariableParameters(2, LanguageConstants.String)
                         .Build());

            yield return(new FunctionOverloadBuilder("extensionResourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithVariableParameters(3, LanguageConstants.String)
                         .Build());

            // TODO: Not sure about return type
            yield return(new FunctionOverloadBuilder("providers")
                         .WithReturnType(LanguageConstants.Array)
                         .WithOptionalFixedParameters(1, LanguageConstants.String, LanguageConstants.String)
                         .Build());

            // TODO: return type is string[]
            yield return(new FunctionOverloadBuilder("pickZones")
                         .WithReturnType(LanguageConstants.Array)
                         .WithOptionalFixedParameters(3, LanguageConstants.String, LanguageConstants.String, LanguageConstants.String, LanguageConstants.Int, LanguageConstants.Int)
                         .Build());

            yield return(new FunctionOverloadBuilder("reference")
                         .WithReturnType(LanguageConstants.Object)
                         .WithOptionalFixedParameters(1, LanguageConstants.String, LanguageConstants.String, LanguageConstants.String)
                         .WithFlags(FunctionFlags.RequiresInlining)
                         .Build());

            yield return(new FunctionWildcardOverload("list*", LanguageConstants.Any, 2, 3, new[] { LanguageConstants.String, LanguageConstants.String, LanguageConstants.Object }, null, new Regex("^list[a-zA-Z]*"), FunctionFlags.RequiresInlining));
        }
Beispiel #9
0
        private static ImmutableDictionary <string, NamespaceSymbol> GetBuiltInNamespaces(ResourceScopeType targetScope)
        {
            var namespaces = new NamespaceSymbol[] { new SystemNamespaceSymbol(), new AzNamespaceSymbol(targetScope) };

            return(namespaces.ToImmutableDictionary(property => property.Name, property => property, LanguageConstants.IdentifierComparer));
        }
Beispiel #10
0
 private static ResourceScopeReference CreateResourceScopeReference(ResourceScopeType resourceScope)
 => resourceScope switch
 {
Beispiel #11
0
 public SemanticModel(FileSymbol root, ITypeManager typeManager, IDictionary <SyntaxBase, Symbol> bindings, ResourceScopeType targetScope)
 {
     this.Root        = root;
     this.typeManager = typeManager;
     this.TargetScope = targetScope;
     this.bindings    = bindings.ToImmutableDictionary();
 }
Beispiel #12
0
        public static ScopeData?TryGetScopeData(ResourceScopeType currentScope, TypeSymbol scopeType)
        {
            switch (currentScope)
            {
            case ResourceScopeType.TenantScope:
                switch (scopeType)
                {
                case TenantScopeType tenantScopeType:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.TenantScope
                    });

                case ManagementGroupScopeType managementGroupScopeType when managementGroupScopeType.Arguments.Length == 1:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.ManagementGroupScope,
                        ManagementGroupNameProperty = managementGroupScopeType.Arguments[0].Expression
                    });

                case SubscriptionScopeType subscriptionScopeType when subscriptionScopeType.Arguments.Length == 1:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.SubscriptionScope,
                        SubscriptionIdProperty = subscriptionScopeType.Arguments[0].Expression
                    });
                }
                break;

            case ResourceScopeType.ManagementGroupScope:
                switch (scopeType)
                {
                case TenantScopeType tenantScopeType:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.TenantScope
                    });

                case ManagementGroupScopeType managementGroupScopeType when managementGroupScopeType.Arguments.Length == 0:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.ManagementGroupScope
                    });

                case ManagementGroupScopeType managementGroupScopeType when managementGroupScopeType.Arguments.Length == 1:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.ManagementGroupScope,
                        ManagementGroupNameProperty = managementGroupScopeType.Arguments[0].Expression
                    });

                case SubscriptionScopeType subscriptionScopeType when subscriptionScopeType.Arguments.Length == 1:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.SubscriptionScope,
                        SubscriptionIdProperty = subscriptionScopeType.Arguments[0].Expression
                    });
                }
                break;

            case ResourceScopeType.SubscriptionScope:
                switch (scopeType)
                {
                case TenantScopeType tenantScopeType:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.TenantScope
                    });

                case SubscriptionScopeType subscriptionScopeType when subscriptionScopeType.Arguments.Length == 0:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.SubscriptionScope
                    });

                case ResourceGroupScopeType resourceGroupScopeType when resourceGroupScopeType.Arguments.Length == 1:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.ResourceGroupScope,
                        ResourceGroupProperty = resourceGroupScopeType.Arguments[0].Expression
                    });
                }
                break;

            case ResourceScopeType.ResourceGroupScope:
                switch (scopeType)
                {
                case TenantScopeType tenantScopeType:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.TenantScope
                    });

                case ResourceGroupScopeType resourceGroupScopeType when resourceGroupScopeType.Arguments.Length == 0:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.ResourceGroupScope
                    });

                case ResourceGroupScopeType resourceGroupScopeType when resourceGroupScopeType.Arguments.Length == 1:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.ResourceGroupScope,
                        ResourceGroupProperty = resourceGroupScopeType.Arguments[0].Expression
                    });

                case ResourceGroupScopeType resourceGroupScopeType when resourceGroupScopeType.Arguments.Length == 2:
                    return(new ScopeData {
                        RequestedScope = ResourceScopeType.ResourceGroupScope,
                        SubscriptionIdProperty = resourceGroupScopeType.Arguments[0].Expression,
                        ResourceGroupProperty = resourceGroupScopeType.Arguments[1].Expression
                    });
                }
                break;
            }

            return(null);
        }
Beispiel #13
0
        private static IEnumerable <FunctionOverload> GetAzOverloads(ResourceScopeType resourceScope)
        {
            foreach (var(functionOverload, allowedScopes) in GetScopeFunctions())
            {
                // we only include it if it's valid at all of the scopes that the template is valid at
                if (resourceScope == (resourceScope & allowedScopes))
                {
                    yield return(functionOverload);
                }

                // TODO: add banned function to explain why a given function isn't available
            }

            // TODO: Add schema for return type
            yield return(new FunctionOverloadBuilder("deployment")
                         .WithReturnType(GetDeploymentReturnType(resourceScope))
                         .WithDescription("Returns information about the current deployment operation.")
                         .Build());

            yield return(new FunctionOverloadBuilder("environment")
                         .WithReturnType(GetEnvironmentReturnType())
                         .WithDescription("Returns information about the Azure environment used for deployment.")
                         .Build());

            // TODO: This is based on docs. Verify
            // the resourceId function relies on leading optional parameters that are disambiguated at runtime
            // modeling this as multiple overload with all possible permutations of the leading parameters
            const string resourceIdDescription = "Returns the unique identifier of a resource. You use this function when the resource name is ambiguous or not provisioned within the same template. The format of the returned identifier varies based on whether the deployment happens at the scope of a resource group, subscription, management group, or tenant.";

            yield return(new FunctionOverloadBuilder("resourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription(resourceIdDescription)
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The resource name segment")
                         .Build());

            yield return(new FunctionOverloadBuilder("resourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription(resourceIdDescription)
                         .WithRequiredParameter("subscriptionId", LanguageConstants.String, "The subscription ID")
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The resource name segment")
                         .Build());

            yield return(new FunctionOverloadBuilder("resourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription(resourceIdDescription)
                         .WithRequiredParameter("resourceGroupName", LanguageConstants.String, "The resource group name")
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The resource name segment")
                         .Build());

            yield return(new FunctionOverloadBuilder("resourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription(resourceIdDescription)
                         .WithRequiredParameter("subscriptionId", LanguageConstants.String, "The subscription ID")
                         .WithRequiredParameter("resourceGroupName", LanguageConstants.String, "The resource group name")
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The resource name segment")
                         .Build());

            // the subscriptionResourceId function relies on leading optional parameters that are disambiguated at runtime
            // modeling this as multiple overload with all possible permutations of the leading parameters
            const string subscriptionResourceIdDescription = "Returns the unique identifier for a resource deployed at the subscription level.";

            yield return(new FunctionOverloadBuilder("subscriptionResourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription(subscriptionResourceIdDescription)
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The resource name segment")
                         .Build());

            yield return(new FunctionOverloadBuilder("subscriptionResourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription(subscriptionResourceIdDescription)
                         .WithRequiredParameter("subscriptionId", LanguageConstants.String, "The subscription ID")
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The resource name segment")
                         .Build());

            yield return(new FunctionOverloadBuilder("tenantResourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription("Returns the unique identifier for a resource deployed at the tenant level.")
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The resource name segment")
                         .Build());

            yield return(new FunctionOverloadBuilder("extensionResourceId")
                         .WithReturnType(LanguageConstants.String)
                         .WithDescription("Returns the resource ID for an [extension](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/extension-resource-types) resource, which is a resource type that is applied to another resource to add to its capabilities.")
                         .WithRequiredParameter("resourceId", LanguageConstants.String, "The resource ID for the resource that the extension resource is applied to")
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "Type of the extension resource including resource provider namespace")
                         .WithVariableParameter("resourceName", LanguageConstants.String, minimumCount: 1, "The extension resource name segment")
                         .Build());

            // TODO: Not sure about return type
            yield return(new FunctionOverloadBuilder("providers")
                         .WithReturnType(LanguageConstants.Array)
                         .WithDescription("Returns information about a resource provider and its supported resource types. If you don't provide a resource type, the function returns all the supported types for the resource provider.")
                         .WithRequiredParameter("providerNamespace", LanguageConstants.String, "the namespace of the provider")
                         .WithOptionalParameter("resourceType", LanguageConstants.String, "The type of resource within the specified namespace")
                         .Build());

            // TODO: return type is string[]
            // TODO: Location param should be of location type if we ever add it
            yield return(new FunctionOverloadBuilder("pickZones")
                         .WithReturnType(LanguageConstants.Array)
                         .WithDescription("Determines whether a resource type supports zones for a region.")
                         .WithRequiredParameter("providerNamespace", LanguageConstants.String, "The resource provider namespace for the resource type to check for zone support")
                         .WithRequiredParameter("resourceType", LanguageConstants.String, "The resource type to check for zone support")
                         .WithRequiredParameter("location", LanguageConstants.String, "The region to check for zone support")
                         .WithOptionalParameter("numberOfZones", LanguageConstants.Int, "The number of logical zones to return. The default is 1. The number must a positive integer from 1 to 3. Use 1 for single-zoned resources. For multi-zoned resources, the value must be less than or equal to the number of supported zones.")
                         .WithOptionalParameter("offset", LanguageConstants.Int, "The offset from the starting logical zone. The function returns an error if offset plus numberOfZones exceeds the number of supported zones.")
                         .Build());

            // TODO: Change 'Full' to literal type after verifying in the runtime source
            yield return(new FunctionOverloadBuilder("reference")
                         .WithReturnType(LanguageConstants.Object)
                         .WithDescription("Returns an object representing a resource's runtime state.")
                         .WithRequiredParameter("resourceNameOrIdentifier", LanguageConstants.String, "Name or unique identifier of a resource. When referencing a resource in the current template, provide only the resource name as a parameter. When referencing a previously deployed resource or when the name of the resource is ambiguous, provide the resource ID.")
                         .WithOptionalParameter("apiVersion", LanguageConstants.String, "API version of the specified resource. This parameter is required when the resource isn't provisioned within same template.")
                         .WithOptionalParameter("full", LanguageConstants.String, "Value that specifies whether to return the full resource object. If you don't specify 'Full', only the properties object of the resource is returned. The full object includes values such as the resource ID and location.")
                         .WithFlags(FunctionFlags.RequiresInlining)
                         .Build());

            // TODO: Doc parameters need an update
            yield return(new FunctionWildcardOverloadBuilder("list*", new Regex("^list[a-zA-Z]*"))
                         .WithReturnType(LanguageConstants.Any)
                         .WithDescription("The syntax for this function varies by name of the list operations. Each implementation returns values for the resource type that supports a list operation. The operation name must start with list. Some common usages are `listKeys`, `listKeyValue`, and `listSecrets`.")
                         .WithRequiredParameter("resourceNameOrIdentifier", LanguageConstants.String, "Name or unique identifier of a resource. When referencing a resource in the current template, provide only the resource name as a parameter. When referencing a previously deployed resource or when the name of the resource is ambiguous, provide the resource ID.")
                         .WithRequiredParameter("apiVersion", LanguageConstants.String, "API version of resource runtime state. Typically, in the format, yyyy-mm-dd.")
                         .WithOptionalParameter("functionValues", LanguageConstants.Object, "An object that has values for the function. Only provide this object for functions that support receiving an object with parameter values, such as listAccountSas on a storage account. An example of passing function values is shown in this article.")
                         .WithFlags(FunctionFlags.RequiresInlining)
                         .Build());
        }
 public ResourceScopeReference(string name, ResourceScopeType resourceScopeType)
     : base(name)
 {
     ResourceScopeType = resourceScopeType;
 }
Beispiel #15
0
 public SemanticModel(FileSymbol root, ITypeManager typeManager, IDictionary <SyntaxBase, Symbol> bindings, ResourceScopeType targetScope)
 {
     this.Root                   = root;
     this.typeManager            = typeManager;
     this.TargetScope            = targetScope;
     this.bindings               = bindings.ToImmutableDictionary();
     this.emitLimitationInfoLazy = new Lazy <EmitLimitationInfo>(() => EmitLimitationCalculator.Calculate(this));
 }