Fix Issue 12705 and Fixup Pull 3501 - Default trust implies @system, and typeof(func) should
extract proper function attributes.