SI-7011 Fix finding constructor type in captured var definitions

If a captured var was initialized with an empty tree then finding
the type of the empty tree was being handled improperly. The fix is
to look for primary constructors on the tree's type symbol rather than
the tree's symbol.

A test is included. In order to make the problem more testable the debug
logging of the issue is changed to a debug warn.

review @retronym