

def visit_Attribute(self, node):
    if isinstance(node.ctx, _ast.Store):
        if (node.attr == self.attr):
            (src, funclineno) = inspect.getsourcelines(self.func)
            lineno = ((funclineno + node.lineno) - 1)
            raise PyMTLError('Cannot write .{attr} in a {kind} block!\n\n {lineno} {srccode}\n File: {filename}\n Function: {funcname}\n Line: {lineno}\n'.format(attr=src.attr, kind={
                'value': '@tick',
                'next': '@combinational',
            }[self.attr], srccode=src[(node.lineno - 1)], filename=inspect.getfile(self.func), funcname=self.func.func_name, lineno=lineno))

dataset/ETHPy150Open cornell-brg/pymtl/pymtl/tools/simulation/ast_visitor.py DetectIncorrectValueNext.visit_Attribute/VarMisuse@77/146 `self`->`src`