It's possible to specify refer to an undefined derived type as the type of a
component of another derived type and then never define the type of the
component. We were not detecting this situation. To fix this, I added
a field to the symbol's DerivedTypeDetails and checked for it when
performing other derived type checks.
I also had to record the fact that error messages were previously
emitted for the same problem in some cases so that I could avoid
duplicate messages.
I also added a test.
Is isDefined_ needed? If a type symbol is created due to a forward reference, isForwardReferenced_ will be set; maybe you can clear it when/if the type is defined, and then just test that flag later.