Scripting: improve reporting on cyclic dependency
#KT-48177 fixed the issue is in fact fixed by the previous commit (report error on duplicated import) by normalizing import path before processing, but here we're making error reporting nicer for the case.
This commit is contained in:
committed by
TeamCityServer
parent
c204d7a86f
commit
e60e80f19a
@@ -147,6 +147,17 @@ inline fun<T, R> Iterable<T>.mapSuccess(body: (T) -> ResultWithDiagnostics<R>):
|
||||
results.add(r)
|
||||
}
|
||||
|
||||
/**
|
||||
* maps transformation ([body]) over iterable merging diagnostics
|
||||
* return failure with merged diagnostics after first failed transformation
|
||||
* and success with merged diagnostics and list of not null results if all transformations succeeded
|
||||
*/
|
||||
inline fun<T, R> Iterable<T>.mapNotNullSuccess(body: (T) -> ResultWithDiagnostics<R?>): ResultWithDiagnostics<List<R>> =
|
||||
mapSuccessImpl(body) { results, r ->
|
||||
if (r != null)
|
||||
results.add(r)
|
||||
}
|
||||
|
||||
/**
|
||||
* maps transformation ([body]) over iterable merging diagnostics and flatten the results
|
||||
* return failure with merged diagnostics after first failed transformation
|
||||
|
||||
Reference in New Issue
Block a user