Hi Farvardin
Two things here. One is that yes you have found a bug in typelib.qlb, it doesn't deal properly with aliases for the indirect object - I've fixed this (hopefully without adding any further bugs) and if I can find your e-mail, I'll send you a revised 'typelib.qlb' file.
Second is that even without the bug, the code above wouldn't work. When you define an objects as an 'actor who can carry things' you are effectively making the object a container, therefore if you want to give things to (or put things into) that object, those things must be 'containables'.
So, in this case if 'Peasant3' is a container, the sword must be a 'containable' for it to work. Something like this...
define object <peasant3>
alias <young peasant>
alt <peasant; young>
look <This man is rather young>
speak <"What do you want ?">
detail <young>
type <TLTobject>
type <TLTcontainer>
type <TLTactor>
properties <noSpeak="What do you want ?">
action <wander> if ( $rand(1;10)$ > 4 ) then {
move <peasant3; chateau>
msg <Someone has just left.>
}
else {
move <peasant3; village>
}
end define
define object <sword>
take
type <TLTobject>
type <TLTcontainable>
action <contained> say <Thank you my Lord.>
end define
Note that you have to use the 'action when contained' option in QDK to print a message (or do anything else for that matter) - the inbuilt GIVE options are completely ignored if you use typelib.qlb. They have to be, because rather than 'disappearing' the sword into limbo land it now gets tucked away where it can still be retrieved.
Try examining the young peasant after you've given him the sword and you'll see something like...
The man is rather young
He is carrying a
sword.You'll find that;
Take the sword from the young peasant (or just take sword) works too

This sort of thing is what typelib is all about really, but it does require a bit more work than usual to get the benefit.
Al