mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Provide a Printable CRTP parent to replace HasPrintable templates. (#3166)
With the toolchain splitting namespaces, ostream.h's `operator<<` templates aren't reliably found with name lookup, likely due to the loss of associated namespaces (zygoloid commented on this at https://github.com/carbon-language/carbon-lang/pull/3161#discussion_r1307941999). This is especially a barrier to moving the lex files into `Carbon::Lex`; versus other parts of the toolchain, they contain more printable types which are used cross-namespace, including `Carbon::Testing`. As a consequence, I'm looking at migrating ostream.h to a more reliable approach that doesn't rely as much on everything being in the `Carbon` namespace.
This commit is contained in:
@@ -183,8 +183,7 @@ auto ImplScope::TryResolve(Nonnull<const Value*> constraint_type,
|
||||
CARBON_ASSIGN_OR_RETURN(
|
||||
Nonnull<const Value*> type,
|
||||
type_checker.Substitute(local_bindings, intrinsic.type));
|
||||
IntrinsicConstraint converted = {
|
||||
.type = type, .kind = intrinsic.kind, .arguments = {}};
|
||||
IntrinsicConstraint converted(type, intrinsic.kind, {});
|
||||
converted.arguments.reserve(intrinsic.arguments.size());
|
||||
for (Nonnull<const Value*> argument : intrinsic.arguments) {
|
||||
CARBON_ASSIGN_OR_RETURN(
|
||||
|
||||
Reference in New Issue
Block a user