Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong duplicate definition error for nested functions #87

Closed
brubraz opened this issue Jan 16, 2022 · 1 comment · Fixed by #96
Closed

Wrong duplicate definition error for nested functions #87

brubraz opened this issue Jan 16, 2022 · 1 comment · Fixed by #96
Assignees
Labels
bug Something isn't working

Comments

@brubraz
Copy link

brubraz commented Jan 16, 2022

Describe the bug
Wrong duplicate definition error for nested functions.

To Reproduce
Steps to reproduce the behavior:

  1. Create a function named "example()" in a nested match /databases/{database}/documents/collectionA
  2. Create a function named "example()" in a nested match /databases/{database}/documents/collectionB
  3. See error Duplicate definions with name example

Expected behavior
The plugin should not search for duplicated functions in sibling matches structures.

Screenshots
image

Possible solution
In src/main/kotlin/co/anbora/labs/firebase/ide/inspections/DuplicateFunctionsInspection.kt
DuplicateFunctionsInspection.kt

Concat the match path of the function in the key for comparison, at line: 29
val key = it.identifierExpr?.text + "_" + it.functionParameterList?.functionParameterList?.size

@dalgarins dalgarins self-assigned this Jan 16, 2022
@dalgarins dalgarins added the bug Something isn't working label Jan 16, 2022
@dalgarins dalgarins mentioned this issue May 6, 2022
@dalgarins dalgarins linked a pull request May 6, 2022 that will close this issue
@dalgarins
Copy link
Contributor

@bbrazsilveira let me know if the issue was fixed to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants