Skip to content

Commit

Permalink
Fix ktype overrides (#77)
Browse files Browse the repository at this point in the history
* Fix ktype overrides

Noticed while testing local publishing

* Spotless

* Update comment
  • Loading branch information
ZacSweers authored Jun 6, 2024
1 parent 9ac48ce commit 671a5eb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
uses: gradle/actions/setup-gradle@v3

- name: Test
run: ./gradlew check
run: |
# Run compileCommonMainKotlinMetadata to ensure metadata compilation works too, as it's
# not covered under the normal check command
./gradlew check compileCommonMainKotlinMetadata
- name: Publish (default branch only)
if: github.repository == 'slackhq/EitherNet' && github.ref == 'refs/heads/main'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ internal expect class KTypeImpl(
arguments: List<KTypeProjection>,
isMarkedNullable: Boolean,
annotations: List<Annotation>,
) : KType, EitherNetKType
) : KType, EitherNetKType {
override val classifier: KClassifier?
override val arguments: List<KTypeProjection>
override val isMarkedNullable: Boolean
override val annotations: List<Annotation>
}

@InternalEitherNetApi
public fun KType.canonicalize(): KType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ internal actual val KClass<*>.qualifiedNameForComparison: String?

internal actual class KTypeImpl
actual constructor(
override val classifier: KClassifier?,
override val arguments: List<KTypeProjection>,
override val isMarkedNullable: Boolean,
override val annotations: List<Annotation>,
actual override val classifier: KClassifier?,
actual override val arguments: List<KTypeProjection>,
actual override val isMarkedNullable: Boolean,
actual override val annotations: List<Annotation>,
) : KType, EitherNetKType {
private val impl = EitherNetKTypeImpl(classifier, arguments, isMarkedNullable, annotations)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ internal actual val KClass<*>.qualifiedNameForComparison: String?

internal actual class KTypeImpl
actual constructor(
override val classifier: KClassifier?,
override val arguments: List<KTypeProjection>,
override val isMarkedNullable: Boolean,
override val annotations: List<Annotation>,
actual override val classifier: KClassifier?,
actual override val arguments: List<KTypeProjection>,
actual override val isMarkedNullable: Boolean,
actual override val annotations: List<Annotation>,
) : KType, EitherNetKType {
private val impl = EitherNetKTypeImpl(classifier, arguments, isMarkedNullable, annotations)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ internal actual val KClass<*>.qualifiedNameForComparison: String?

internal actual class KTypeImpl
actual constructor(
override val classifier: KClassifier?,
override val arguments: List<KTypeProjection>,
override val isMarkedNullable: Boolean,
override val annotations: List<Annotation>,
actual override val classifier: KClassifier?,
actual override val arguments: List<KTypeProjection>,
actual override val isMarkedNullable: Boolean,
actual override val annotations: List<Annotation>,
) : KType, EitherNetKType {
private val impl = EitherNetKTypeImpl(classifier, arguments, isMarkedNullable, annotations)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ internal actual val KClass<*>.qualifiedNameForComparison: String?

internal actual class KTypeImpl
actual constructor(
override val classifier: KClassifier?,
override val arguments: List<KTypeProjection>,
override val isMarkedNullable: Boolean,
override val annotations: List<Annotation>,
actual override val classifier: KClassifier?,
actual override val arguments: List<KTypeProjection>,
actual override val isMarkedNullable: Boolean,
actual override val annotations: List<Annotation>,
) : KType, EitherNetKType {
private val impl = EitherNetKTypeImpl(classifier, arguments, isMarkedNullable, annotations)

Expand Down

0 comments on commit 671a5eb

Please sign in to comment.