in reply to Re^2: Moose composing role with required attribute into existing instance
in thread Moose composing role with required attribute into existing instance
You are correct the syntax for the code you posted needs the class followed by roles. I initially misread Point as a Role. I tend to put all of the appended roles in a list form though just to improve readability (even if there is just one). Also if you don't like the method call on a method result you can separate them into two and the required=>1, elements of the attributes still won't error.
Update:If you are using this in boilerplate the role can be a dummy name as well and it still works!
my $named_point_class = with_traits(
my $point_instance = $named_point_class->new(
x => 1,
y => 1,
name => 'my_point',