Yes, you are right : it's a bug.
As temporary workaroud, you can use:
class "A::B::C" as A_B_C {
f()
x
}
The parser code need some serious refactor here.
I think also we may remove the feature that automatically creates package when class names have dot (.) or :: in their declaration. Not sure that it is a really good/usefull feature