You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detekt should not report UnusedImports for imports that are actually required.
Observed Behavior
Detekt flags an import that is required as UnusedImports.
Steps to Reproduce
In this code
import org.eclipse.apoapsis.ortserver.dao.createDataSource
private fun Application.createDataSource(): DataSource {
val configManager: ConfigManager by inject()
val dataSourceConfig = DatabaseConfig.create(configManager)
return createDataSource(dataSourceConfig)
}
there is both the imported createDataSource (non-extension) function, and a function of the same name in the same file. Needless to say that createDataSource(dataSourceConfig) cannot call Application.createDataSource() as the former has an argument provided, but the latter takes none. So it's clear that only org.eclipse.apoapsis.ortserver.dao.createDataSource can be meant, and has to be imported.
Context
I'm trying to resolve all Detekt hints in my code base, using type resolution.
Your Environment
Version of detekt used: 1.23.6
Version of Gradle used (if applicable): 8.7
Gradle scan link (add --scan option when running the gradle task): n/a
Expected Behavior
Detekt should not report
UnusedImports
for imports that are actually required.Observed Behavior
Detekt flags an import that is required as
UnusedImports
.Steps to Reproduce
In this code
there is both the imported
createDataSource
(non-extension) function, and a function of the same name in the same file. Needless to say thatcreateDataSource(dataSourceConfig)
cannot callApplication.createDataSource()
as the former has an argument provided, but the latter takes none. So it's clear that onlyorg.eclipse.apoapsis.ortserver.dao.createDataSource
can be meant, and has to be imported.Context
I'm trying to resolve all Detekt hints in my code base, using type resolution.
Your Environment
--scan
option when running the gradle task): n/aThe text was updated successfully, but these errors were encountered: