ufront / ufront-mvc

The core MVC framework that powers ufront
MIT License
17 stars 15 forks source link

Compiler reports incorrect error position #35

Closed kevinresol closed 8 years ago

kevinresol commented 8 years ago

I am always having the compile error being "masked" by macro

something like this:

src/controller/AuthController.hx:24: lines 24-57 : Failed to parse function argument `args`.  The args object must contain only the types String, Int, Float and Bool. 
src/controller/AuthController.hx:24: lines 24-57 : Unexpected }

Note that the unepxcted }is not at AuthController.hx:24: lines 24-57, it is at somewhere else (maybe in an API)

jasononeil commented 8 years ago

Hey @kevinresol , I've committed a change that will make sure neither ControllerMacros nor ApiMacros will "swallow" the error message.

Unfortunately it makes for some situations where both an error and a warning are reported, at different positions, for the same problem. It's quite hard to know which position is the correct one to display, so I'm just displaying both for now.

We can have a go at a better solution another time if needed.

kevinresol commented 8 years ago

:+1: thanks!