Little Farage :D
Yeah, um, I'd be pretty hard-line on this. I was raised by very racist parents, and there were a couple of occasions I parroted their phrases and used bad words. The world around me came down on me like a TON of bricks. The school. The other child's parents even spoke to me. I was MORTIFIED. I was shamed and re-educated - more importantly, I learned that such views were NOT acceptable if I wanted to b a pleasant citizen in the world.
I was, like, 5, so we're not talking some late teen Damascene conversion here, but still, those 'talks' really stuck with me.
I would not invite the child. 6 is old enough to learn you don't say rude things, and if you do say those things or hold those views, you will not be included in polite society. You will be shunned and excluded until you can behave and be kind.
Really this is the sort of thing we should have been doing with racists all along. Every aunt who made a grim comment over dinner, every racist BIL who sneered, every 'mate' who said something rude about a minority colleague. They should be challenged, stood up to and told "that is unacceptable."
Instead we shrugged them all off as 'just what they're like', 'bit of banter innit', and now look where we are. All firmly out of the woodwork.
A little humiliation and shunning goes a long way. If the kid asks, or his parents do, be bold. Explain your reasons. Hopefully if he's anything like me, he'll realise the utter shamefulness of his comments, never again repeat them and begin to challenge his parents when they say them (as I did - eventually we all just stopped talking about it, although now they're practically seig-heiling their new Fuhrer and I don't see them much.)