That is, trying to assign <LuaEntity>.last_user = nil throws an error, but LuaEntities returned via the scripting engine - such as find_entities_filtered - can have a nil value for that field.
This is bad on two fronts:
The first is that this makes no sense; if the game can give LuaEntities with nil value for last_user, that must be an acceptable value (ie causes no issues) for that parameter, and thus it makes no sense to forbid a nil assign.
The second problem is more practical: it means you cannot "clone" an entity directly; the entity that exists may not be allowed to be recreated with that exact data. Just copying all the entity data from one to another runs the risk of throwing an error, simply because one of the fields contains a value which is not permissible to assign to that same field.
Hell, you can throw an error by assigning an entity its own parameters: entity.last_user = entity.last_user will throw an error if the entity has a nil user, as some script-returned entities do.
LuaEntity.last_user can be nil on a LuaEntity returned from the game, but that field does not accept nil assign
Re: LuaEntity.last_user can be nil on a LuaEntity returned from the game, but that field does not accept nil assign
Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.
Re: LuaEntity.last_user can be nil on a LuaEntity returned from the game, but that field does not accept nil assign
Yes.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.