buggood first issue
Metriche repository
- Star
- (571 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Describe the bug
Diktat suggests to use data class for actual or expected classes.
Expected behavior
Diktat doesn't detect it as error
Observed behavior
Steps to Reproduce
/**
* Class that holds value and shares atomic reference to the value
*
* @param valueToStore value to store
*/
@Suppress("USE_DATA_CLASS")
expect class GenericAtomicReference<T>(valueToStore: T) {
/**
* @return stored value
*/
fun get(): T
/**
* @param newValue new value to store
*/
fun set(newValue: T)
}
@Suppress("USE_DATA_CLASS")
actual class GenericAtomicReference<T> actual constructor(valueToStore: T) {
private val holder: kotlin.native.concurrent.AtomicReference<T> = kotlin.native.concurrent.AtomicReference(valueToStore)
actual fun get(): T = holder.value
actual fun set(newValue: T) {
holder.value = newValue
}
}
Environment information
- diktat version: 1.2.5
- build tool (maven/gradle): gralde
- how is diktat run (CLI, plugin, etc.): plugin
- kotlin version: 1.8.20
- operating system: Linux
- link to a project (if your project is public): saveourtool/save-cloud