expandAlias("command", nil) should not error

Bug #1456794 reported by Vadim Peretokin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mudlet
Opinion
Low
Unassigned

Bug Description

expandAlias("x", nil) currently gives this error: <Send: wrong argument type>

expandAlias("x", nil) should be treated the same as expandAlias("x")

Changed in mudlet:
importance: Undecided → Low
Revision history for this message
Stephen Lyons (slysven) wrote :

This Lua sub-system command is mapped to TLuaInterpreter::Send(...) and the second argument, if specified, is a boolean that is recorded as wantPrint (and defaults to TRUE if NOT specified) and then dispatched to the Host class instance with:

pHost->send( QString( luaSendText.c_str() ), wantPrint, false );

Given that boolean FALSE seems to be largely inter-changeable with NIL I don't see how expandAlias("x", nil) can be treated as expandAlias("x") when the latter is already coded as expandAlias("x", true) and NOT expandAlias("x", false)...

I suspect this will become a WON'T FIX or it will break existing code won't it?

Fair enough, the error messages are not up to scratch for this function, but sadly that is not uncommon!

Changed in mudlet:
status: New → Confirmed
Revision history for this message
Vadim Peretokin (vperetokin) wrote :

expandAlias("x", nil) and expandAlias("x") are exactly the same as far as Lua code is concerned.

Revision history for this message
Vadim Peretokin (vperetokin) wrote :

Migrating issues to Github, please follow the new discussion here: https://github.com/Mudlet/Mudlet/issues/582

This issue needs to be closed and there is no appropriate status, so will set it to "Opinion" just for migration purposes.

Changed in mudlet:
status: Confirmed → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.