fix some compilation issue with 2.066.0

- const applies to return type not the function
- resolve forward referenced alias declaration