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_OVERLOADING_FUNCTION_ARGUMENTS false positive with mixed inline/non-inline overloads #1593

Closed
0x6675636b796f75676974687562 opened this issue Dec 27, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@0x6675636b796f75676974687562
Copy link
Member

0x6675636b796f75676974687562 commented Dec 27, 2022

Consider the following fragment:

inline fun <reified T> getLogger(): Logger = getLogger(T::class)

fun getLogger(clazz: Class<*>): Logger = LoggerFactory.getLogger(clazz)

fun getLogger(clazz: KClass<*>): Logger = getLogger(clazz.java)

Diktat reports a WRONG_OVERLOADING_FUNCTION_ARGUMENTS false positive, despite:

  1. the 1st function is an inline one, and
  2. the 1st function has a type parameter while others do not (so, technically, the 1st function may also be considered having exactly one argument)

Environment information

  • diktat version: 1.2.4.2

Related

@icemachined
Copy link
Member

the issue is not reproduced in diktat version 1.2.4.2, it is reproduced in 1.2.4.1 which was cut before #1594 was merged

@0x6675636b796f75676974687562
Copy link
Member Author

Duplicate of #1594

@0x6675636b796f75676974687562 0x6675636b796f75676974687562 marked this as a duplicate of #1594 Mar 15, 2023
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

No branches or pull requests

2 participants