[Wasm] Require a description on each usage of SourceLocation.NoLocation
This commit is contained in:
@@ -10,6 +10,6 @@ value class LocationHolder(val location: SourceLocation)
|
||||
|
||||
inline fun <R> withLocation(location: SourceLocation, body: LocationHolder.() -> R): R = LocationHolder(location).body()
|
||||
|
||||
inline fun <R> withNoLocation(body: LocationHolder.() -> R): R = withLocation(SourceLocation.NoLocation, body)
|
||||
inline fun <R> withNoLocation(description: String, body: LocationHolder.() -> R): R = withLocation(SourceLocation.NoLocation(description), body)
|
||||
|
||||
inline fun <R> withTBDLocation(body: LocationHolder.() -> R): R = withLocation<R>(SourceLocation.TBDLocation, body)
|
||||
|
||||
@@ -6,8 +6,13 @@
|
||||
package org.jetbrains.kotlin.wasm.ir.source.location
|
||||
|
||||
sealed class SourceLocation {
|
||||
object NoLocation: SourceLocation()
|
||||
object TBDLocation: SourceLocation()
|
||||
private object NoLocation : SourceLocation()
|
||||
object TBDLocation : SourceLocation()
|
||||
|
||||
data class Location(val file: String, val line: Int, val column: Int) : SourceLocation()
|
||||
|
||||
companion object {
|
||||
@Suppress("FunctionName", "UNUSED_PARAMETER")
|
||||
fun NoLocation(description: String): SourceLocation = NoLocation
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user