@@ -9460,28 +9460,39 @@ Parser<ManagedTokenSource>::parse_paren_prefixed_type ()
94609460 {
94619461 // release vector pointer
94629462 std::unique_ptr<AST::Type> released_ptr = std::move (types[0 ]);
9463+
9464+ // We don't want to convert it to TraitBound as it could be a
9465+ // ParenthesisedType
9466+
9467+ return std::unique_ptr<AST::ParenthesisedType> (
9468+ new AST::ParenthesisedType (std::move (released_ptr),
9469+ left_delim_locus));
9470+
94639471 /* HACK: attempt to convert to trait bound. if fails, parenthesised
94649472 * type */
9465- std::unique_ptr<AST::TraitBound> converted_bound (
9466- released_ptr->to_trait_bound (true ));
9467- if (converted_bound == nullptr )
9468- {
9469- // parenthesised type
9470- return std::unique_ptr<AST::ParenthesisedType> (
9471- new AST::ParenthesisedType (std::move (released_ptr),
9472- left_delim_locus));
9473- }
9474- else
9475- {
9476- // trait object type (one bound)
94779473
9478- // get value semantics trait bound
9479- AST::TraitBound value_bound (*converted_bound);
9474+ /*
9475+ std::unique_ptr<AST::TraitBound> converted_bound (
9476+ released_ptr->to_trait_bound (true));
9477+ if (converted_bound == nullptr)
9478+ {
9479+ // parenthesised type
9480+ return std::unique_ptr<AST::ParenthesisedType> (
9481+ new AST::ParenthesisedType (std::move (released_ptr),
9482+ left_delim_locus));
9483+ }
9484+ else
9485+ {
9486+ // trait object type (one bound)
94809487
9481- return std::unique_ptr<AST::TraitObjectTypeOneBound> (
9482- new AST::TraitObjectTypeOneBound (value_bound,
9483- left_delim_locus));
9484- }
9488+ // get value semantics trait bound
9489+ AST::TraitBound value_bound (*converted_bound);
9490+
9491+ return std::unique_ptr<AST::TraitObjectTypeOneBound> (
9492+ new AST::TraitObjectTypeOneBound (value_bound,
9493+ left_delim_locus));
9494+ }
9495+ */
94859496 }
94869497 }
94879498 else
0 commit comments