Any way to get file/line for symbol declaration?

Manu turkeyman at gmail.com
Sun Jun 9 21:26:52 UTC 2019


I have some reflection-heavy validation code, it's necessary that I
emit meaningful error messages to the user explaining when inputs
don't meet expectation.

I'm finding that emitting an FQN along with the error messages is not
super productive.
I'd REALLY like to emit the error with the proper file and line prefix
so that you can click and code editors will go to the problem
declaration.

I can't find any way to dig the Loc of the declaration from the symbol
reference. Does anyone know any tricks? Should I make a PR to expose
the symbol Loc as a traits?


More information about the Digitalmars-d mailing list