result type detection