The following construct type-checked on mypy 0.650, but complains of an undefined name on 0.750. Sorry not to have a more precise range; I'm guessing the regression arrived with the new semantic analyzer.
class Outer(Base):
field: Outer.Inner # E: Name 'Outer.Inner' is not defined
class Inner: pass
class Base: pass
All of the following are accepted, though:
# inner class before its use
class Outer(Base):
class Inner: pass
field: Outer.Inner
class Base: pass
# base before its use
class Base: pass
class Outer(Base):
field: Outer.Inner
class Inner: pass
# no base
class Outer:
field: Outer.Inner
class Inner: pass
Behavior is the same in all cases if I make the field annotation say just Inner rather than Outer.Inner. (IIRC I was using Outer.Inner because that made old mypy happier.)
This is mypy v0.750 on Python 3.6.5.