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

False positive WRONG_OVERLOADING_FUNCTION_ARGUMENTS #1623

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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