Ejemplo n.º 1
0
        protected bool SetMemberWorker(Node node, AnalysisUnit unit, string name, IAnalysisSet value)
        {
            PropertyDescriptorValue desc;

            if (_descriptors != null && _descriptors.TryGetValue(name, out desc))
            {
                if (desc.Setter != null)
                {
                    desc.Setter.GetTypesNoCopy(unit, ProjectEntry).Call(
                        node,
                        unit,
                        AnalysisSet.Empty,
                        new[] { value }
                        );
                }
            }

            VariableDef varRef = GetValuesDef(name);

            varRef.AddAssignment(node, unit);

            if (IsMutable(name))
            {
                varRef.MakeUnionStrongerIfMoreThan(ProjectState.Limits.InstanceMembers, value);
                return(varRef.AddTypes(unit, value, declaringScope: DeclaringModule));
            }
            return(false);
        }
 /// <summary>
 /// Handles the base assignment case for assign to a variable, minus variable creation.
 /// </summary>
 protected static bool AssignVariableWorker(Node location, AnalysisUnit unit, IAnalysisSet values, VariableDef vars)
 {
     vars.AddAssignment(location, unit);
     vars.MakeUnionStrongerIfMoreThan(unit.State.Limits.AssignedTypes, values);
     return(vars.Types.Count < unit.State.Limits.AssignedTypes
             ? vars.AddTypes(unit, values)
             : false);
 }
Ejemplo n.º 3
0
Archivo: DDG.cs Proyecto: pdiemi/PTVS
        private bool Assign(VariableDef variable, IAnalysisSet value, Node locationNode)
        {
            var added = variable.AddTypes(_unit, value);

            if (added)
            {
                variable.AddAssignment(new EncodedLocation(_unit, locationNode), _unit.ProjectEntry);
            }
            return(added);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Handles the base assignment case for assign to a variable, minus variable creation.
 /// </summary>
 protected static bool AssignVariableWorker(Node location, AnalysisUnit unit, IAnalysisSet values, VariableDef vars) {
     vars.AddAssignment(location, unit);
     vars.MakeUnionStrongerIfMoreThan(unit.ProjectState.Limits.AssignedTypes, values);
     return vars.AddTypes(unit, values);
 }