Pytocs.TypeInference.State.setAttrType C# (CSharp) Method

setAttrType() private static method

private static setAttrType ( Analyzer analyzer, AttributeAccess attr, DataType targetType, DataType attrType ) : void
analyzer Analyzer
attr AttributeAccess
targetType DataType
attrType DataType
return void
        private static void setAttrType(Analyzer analyzer, AttributeAccess attr, DataType targetType, DataType attrType)
        {
            if (targetType.isUnknownType())
            {
                analyzer.putProblem(attr, "Can't set attribute for UnknownType");
                return;
            }
            ISet<Binding> bs = targetType.Table.LookupAttribute(attr.FieldName.Name);
            if (bs != null)
            {
                analyzer.addRef(attr, targetType, bs);
            }
            targetType.Table.Insert(analyzer, attr.FieldName.Name, attr, attrType, BindingKind.ATTRIBUTE);
        }