MCPcopy Index your code
hub / github.com/python/mypy / test_invalid_register_source

Method test_invalid_register_source

mypyc/test/test_ircheck.py:98–102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 assert_has_error(fn, FnError(source=goto, desc="Invalid control operation target: 1"))
97
98 def test_invalid_register_source(self) -> None:
99 ret = Return(value=Register(type=none_rprimitive, name="r1"))
100 block = self.basic_block([ret])
101 fn = FuncIR(decl=self.func_decl(name="func_1"), arg_regs=[], blocks=[block])
102 assert_has_error(fn, FnError(source=ret, desc="Invalid op reference to register 'r1'"))
103
104 def test_invalid_op_source(self) -> None:
105 ret = Return(value=LoadLiteral(value="foo", rtype=str_rprimitive))

Callers

nothing calls this directly

Calls 7

basic_blockMethod · 0.95
func_declMethod · 0.95
ReturnClass · 0.90
RegisterClass · 0.90
FuncIRClass · 0.90
FnErrorClass · 0.90
assert_has_errorFunction · 0.85

Tested by

no test coverage detected