Good catch! I was just trying to get something to work, but it seems like you found another bug. I am now checking if it is None:
# union flags in w_1 and w_2 and propagate to result
if isinstance(w_result, W_Root) and w_result is not None:
rb_results = {}
if isinstance(w_1, W_Root) and w_1 is not None:
w_1_rbflags = w_1.get_rbflags()
rb_results.update(w_1_rbflags)
if isinstance(w_2, W_Root) and w_2 is not None:
w_2_rbflags = w_2.get_rbflags()
rb_results.update(w_2_rbflags)
w_result.set_rbflags(rb_results)
I now get this error:
[translation:ERROR] UnionError:
Offending annotations:
SomeInstance(can_be_None=False, classdef=pypy.interpreter.baseobjspace.W_Root)
SomeOrderedDict(dictdef=<{SomeImpossibleValue(): SomeImpossibleValue()}>)
Occurred processing the following simple_call:
<MethodDesc 'set_rbflags' of <ClassDef 'pypy.interpreter.baseobjspace.W_Root'> bound to <ClassDef 'pypy.interpreter.baseobjspace.W_Root'> {}> returning
v831 = simple_call(v830, rb_results_0)
In <FunctionGraph of (pypy.interpreter.pyopcode:40)opcode_impl_for_div__star_2 at 0x1c190b10>:
Happened at file /home/ubuntu/pypy2-v5.3.1-src/pypy/interpreter/pyopcode.py line 55
==> w_result.set_rbflags(rb_results)
Known variable annotations:
v830 = SomePBC(can_be_None=False, descriptions={...1...}, knowntype=method, subset_of=None)
rb_results_0 = SomeOrderedDict(dictdef=<{SomeImpossibleValue(): SomeImpossibleValue()}>)
Processing block:
block@203 is a <class 'rpython.flowspace.flowcontext.SpamBlock'>
in (pypy.interpreter.pyopcode:40)opcode_impl_for_div__star_2
containing the following operations:
v830 = getattr(w_result_0, ('set_rbflags'))
v831 = simple_call(v830, rb_results_0)
--end--
I assume this happens because w_result can be a "subset" of None. What is the proper way to check if it's None?