diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-10-26 11:36:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-10-26 11:36:19 +0200 |
commit | 0fc035dd4d51c70231a46d6b8a6ba18a91e8ae43 (patch) | |
tree | 798aa85b019275fcd828d459b0ffb5fa715ebf76 /libbuild2/parser.cxx | |
parent | 9dac152ff70d9dc616318630d634a83d266aee4a (diff) |
Minor diagnostics improvement
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r-- | libbuild2/parser.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index 9ced841..55c5c6c 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -931,7 +931,9 @@ namespace build2 : scope_->find_target_type (n.type)); if (ttype == nullptr) - fail (nloc) << "unknown target type " << n.type; + fail (nloc) << "unknown target type " << n.type << + info << "perhaps the module that defines this target type is " + << "not loaded by project " << *scope_->root_scope (); f (t, tt, nullopt, n.pattern, ttype, move (n.value), nloc); }; @@ -1359,7 +1361,9 @@ namespace build2 : scope_->find_target_type (n.type); if (ttype == nullptr) - fail (nloc) << "unknown target type " << n.type; + fail (nloc) << "unknown target type " << n.type << + info << "perhaps the module that defines this target type is " + << "not loaded by project " << *scope_->root_scope (); if (!gns.empty ()) { @@ -2773,7 +2777,9 @@ namespace build2 optional<string>& e (rp.second); if (t == nullptr) - fail (ploc) << "unknown target type " << n.type; + fail (ploc) << "unknown target type " << n.type << + info << "perhaps the module that defines this target type is " + << "not loaded by project " << *scope_->root_scope (); if (t->factory == nullptr) fail (ploc) << "abstract target type " << t->name << "{}"; @@ -4339,7 +4345,9 @@ namespace build2 const target_type* bt (scope_->find_target_type (bn)); if (bt == nullptr) - fail (t) << "unknown target type " << bn; + fail (t) << "unknown target type " << bn << + info << "perhaps the module that defines this target type is " + << "not loaded by project " << *scope_->root_scope (); // The derive_target_type() call below does not produce a non-abstract // type if passed an abstract base. So we ban this for now (it's unclear |