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

Internal Error (no-unused-imports) #1050

Closed
allco opened this issue Jan 8, 2021 · 2 comments
Closed

Internal Error (no-unused-imports) #1050

allco opened this issue Jan 8, 2021 · 2 comments

Comments

@allco
Copy link

allco commented Jan 8, 2021

The command:

# ktlint -a -F **/*.kt
/Users/alsk/Projects/hb_ep/modules/common/src/debug/java/net/easypark/android/extensions/RxExtensions.kt:1:1: Internal Error (no-unused-imports). Please create a ticket at https://github.com/pinterest/ktlint/issues (if possible, provide the source code that triggered an error) (cannot be auto-corrected)

The code:

package net.easypark.android.extensions

import io.reactivex.Observable

internal fun log(tag: String, value: Any) {
    println("$tag: $value")
}

fun <T> Observable<T>.dump(tag: String): Observable<T> =
    this
        .doFinally { log(tag, "doFinally") }
        .doOnNext { log(tag, "onNext: ${it.toString()}") }
        .doOnError { er -> log(tag, "onError: $er") }
        .doOnSubscribe { log(tag, "onSubscribed") }
        .doOnDispose { log(tag, "onDisposed") }
        .doOnComplete { log(tag, "onComplete") }
  • Version of ktlint used: 0.40.0
  • Operating System and version: MacOS: 10.15.7
@paul-dingemans
Copy link
Collaborator

Duplicates #996 and will be resolved in version 0.41

@romtsn
Copy link
Collaborator

romtsn commented Jan 10, 2021

Yep, this was already fixed, you could try the snapshot in the meantime

@romtsn romtsn closed this as completed Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants