Currently unknown keys when inputting mapping traits have the location set to the Value.
Example:
YAML:1:14: error: unknown key 'UnknownKey' {UnknownKey: SomeValue} ^~~~~~~~~
This is unhelpful for a user as it draws them to fix the wrong item.
Paths
| Differential D93037
[YAML] Use correct source location for unknown key errors. ClosedPublic Authored by njames93 on Dec 10 2020, 8:21 AM.
Details Summary Currently unknown keys when inputting mapping traits have the location set to the Value. YAML:1:14: error: unknown key 'UnknownKey' {UnknownKey: SomeValue} ^~~~~~~~~ This is unhelpful for a user as it draws them to fix the wrong item.
Diff Detail
Unit TestsFailed Event TimelineComment Actions Would be nice to find a way to test this (Maybe a FileCheck test? not sure how to set that up though; don't worry if it is too much work.) This revision is now accepted and ready to land.Dec 10 2020, 9:34 AM Comment Actions
Bit of a pain to set that up explicitly. Thankfully, there are 8 test failures(per platform) introduced by this patch that demonstrate the old unexpected behaviour. This revision was landed with ongoing or failed builds.Dec 11 2020, 8:34 AM Closed by commit rGd380c38e3470: [YAML] Use correct source location for unknown key errors. (authored by njames93). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 310901 llvm/include/llvm/Support/YAMLParser.h
llvm/include/llvm/Support/YAMLTraits.h
llvm/lib/Support/YAMLParser.cpp
llvm/lib/Support/YAMLTraits.cpp
|
clang-tidy: warning: invalid case style for parameter 'message' [readability-identifier-naming]
not useful