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); }
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); }
/// <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); }