How about something like $scriptline but for use with the :error goto. Something like what $scriptline does, the problem is $scriptline is only for the current line within the current alias/event.

How about something that gives the event or alias and line number of whatever called the specific identifier/alias.

Example:

Code:
on *:JOIN:#:{
; stuff here
 did -a joindialog 1 $nick
}
alias did {
!did $1-
:error
if ($2 == joindialog) echo -a error $error -- event: $callevent line: $callline file: $callfile
}

would echo something like "error /did: insufficient parameters (line 7, stuff.als) -- event: onJoin line: 253 file: otherstuff.mrc "

the 'event' could be the name of the remote event, or if it's an alias that calls the other alias. so $callevent could be "$identifier", "/alias", "onjoin", "raw352"

as the error reporting works now it will just give you the line number and file of whatever failed, it doesn't take inheritance into account.

I think it would be debugging problems a lot easier.

Yes I realize there are ways of tracking down bugs manually, but this would allow you to trace bugs more easily. Plus if other people use your script and the error they're getting is an alias called by dozens of places it's harder to track down what called it in the first place, if it called it with improper parameters.

I didn't write this out well. Need sleep.
TL;DR: ways to reference what line and script actually trigger an error within an alias or identifier.