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

Method test_invalid_op_source

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

Source from the content-addressed store, hash-verified

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))
106 block = self.basic_block([ret])
107 fn = FuncIR(decl=self.func_decl(name="func_1"), arg_regs=[], blocks=[block])
108 assert_has_error(
109 fn, FnError(source=ret, desc="Invalid op reference to op of type LoadLiteral")
110 )
111
112 def test_invalid_return_type(self) -> None:
113 ret = Return(value=Integer(value=5, rtype=int32_rprimitive))

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected