Skip to content

Commit

Permalink
Make implementations val final. (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laimiux authored Aug 22, 2024
1 parent ac33937 commit 47077f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package com.instacart.formula
*/
abstract class ActionFormula<Input : Any, Output : Any> : IFormula<Input, Output> {
// Implements the common API used by the runtime.
override val implementation: Formula<Input, Output, Output> = object : Formula<Input, Output, Output>() {
final override val implementation: Formula<Input, Output, Output> = object : Formula<Input, Output, Output>() {
override fun initialState(input: Input) = initialValue(input)

override fun Snapshot<Input, Output>.evaluate(): Evaluation<Output> {
Expand Down
2 changes: 1 addition & 1 deletion formula/src/main/java/com/instacart/formula/Formula.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package com.instacart.formula
* listeners. When it is used to render UI, we call it a render model (Ex: ItemRenderModel).
*/
abstract class Formula<in Input, State, out Output> : IFormula<Input, Output> {
override val implementation: Formula<Input, *, Output>
final override val implementation: Formula<Input, *, Output>
get() = this

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package com.instacart.formula
abstract class StatelessFormula<Input, Output> : IFormula<Input, Output> {

// Implements the common API used by the runtime.
override val implementation = object : Formula<Input, Unit, Output>() {
final override val implementation = object : Formula<Input, Unit, Output>() {
override fun initialState(input: Input) = Unit

override fun Snapshot<Input, Unit>.evaluate(): Evaluation<Output> {
Expand Down

0 comments on commit 47077f9

Please sign in to comment.