-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check for namespace shadowing (#126)
* check for namespace shadowing protoc enforces that the name space resolution stops when it found a relative name which starts with a package fragment contained by the current package e.g: if package is com.foo The type foo.Bar relative name resolution will never reach root path, it will stop searching at com.foo.Bar * add test for name resolution shadowing * resolve_message_name_conflict_with_field_name is now a Shadow case we change the test as this is not a proper case
- Loading branch information
Showing
8 changed files
with
108 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
file: | ||
- name: dep.proto | ||
package: foo.bar | ||
messageType: | ||
- name: FooBar | ||
- name: root.proto | ||
package: com.foo.bar | ||
dependency: | ||
- dep.proto | ||
messageType: | ||
- name: Foo | ||
field: | ||
- name: foobar | ||
number: 1 | ||
label: LABEL_OPTIONAL | ||
typeName: foo.FooBar | ||
jsonName: foobar | ||
syntax: proto3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
source: prost-reflect/tests/main.rs | ||
assertion_line: 79 | ||
expression: actual | ||
--- | ||
causes: [] | ||
help: "'foo.FooBar' is is resolved to 'com.foo.FooBar', which is not defined. The innermost scope is searched first in name resolution. Consider using a leading '.'(i.e., '.foo.FooBar') to start from the outermost scope." | ||
labels: [] | ||
message: "name 'foo.FooBar' is shadowed" | ||
related: [] | ||
severity: error |