Lookup typealias in enclosing declaration when writing type

this seems like an expensive operation.. why was the other way of looking at the declaration wrong?