The issue reappeared and I found the source of the problem. Explicitly assigning a type to the alias PP when instantiating it at the end of dsl.py gets rid of the MyPy errors. It's fixed in this commit, currently just in the counterfactual_transportability branch.
The next two commented-out lines produce a mypy error:
Here's the error:
test_transport.py
uses a similar syntax and does not trigger the error, so I'm probably missing something simple.The next line does not trigger an error: