Skip to content

Commit

Permalink
False positive WRONG_OVERLOADING_FUNCTION_ARGUMENTS (#1623)
Browse files Browse the repository at this point in the history
### What's done:
test case

closes #1594
  • Loading branch information
icemachined authored Mar 15, 2023
1 parent 416171f commit cb102a2
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,36 @@ class OverloadingArgumentsFunctionWarnTest : LintTestBase(::OverloadingArguments
)
}

@Test
@Tag(WarningNames.WRONG_OVERLOADING_FUNCTION_ARGUMENTS)
fun `functions with override modifiers`() {
lintMethod(
"""
|fun list(projectCoordinates: ProjectCoordinates): Flux<FileKey> = list()
| .filter { it.projectCoordinates == projectCoordinates }
|
|override fun list(): Flux<FileKey> = newFileStorage.list()
| .map { fileDto ->
| FileKey(
| projectCoordinates = fileDto.projectCoordinates,
| name = fileDto.name,
| uploadedMillis = fileDto.uploadedTime.toInstant(TimeZone.UTC).toEpochMilliseconds()
| )
| }
""".trimMargin(),
)
}
@Test
@Tag(WarningNames.WRONG_OVERLOADING_FUNCTION_ARGUMENTS)
fun `functions with override modifiers simple`() {
lintMethod(
"""
|fun foo(a: Int) {}
|override fun foo() {}
""".trimMargin()
)
}

@Test
@Tag(WarningNames.WRONG_OVERLOADING_FUNCTION_ARGUMENTS)
fun `functions with unordered, but same modifiers`() {
Expand Down

0 comments on commit cb102a2

Please sign in to comment.