From b0d76b9631298572b2c6e57e671eb36cebd45f28 Mon Sep 17 00:00:00 2001 From: Dima Date: Wed, 1 Sep 2021 13:27:25 +0300 Subject: [PATCH] just delete asInstanceOf (#259) --- .../aqua/semantics/rules/abilities/AbilitiesAlgebra.scala | 2 +- .../aqua/semantics/rules/abilities/AbilitiesInterpreter.scala | 4 ++-- .../main/scala/aqua/semantics/rules/abilities/AbilityOp.scala | 2 +- .../scala/aqua/semantics/rules/names/NamesInterpreter.scala | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesAlgebra.scala b/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesAlgebra.scala index 6d403591..d5ae0d0a 100644 --- a/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesAlgebra.scala +++ b/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesAlgebra.scala @@ -34,7 +34,7 @@ class AbilitiesAlgebra[F[_], Alg[_]](implicit A: InjectK[AbilityOp[F, *], Alg]) def beginScope(token: Token[F]): Free[Alg, Unit] = Free.liftInject[Alg](BeginScope[F](token)) - def endScope(): Free[Alg, Boolean] = + def endScope(): Free[Alg, Unit] = Free.liftInject[Alg](EndScope[F]()) } diff --git a/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesInterpreter.scala b/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesInterpreter.scala index e083dd55..6192031a 100644 --- a/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesInterpreter.scala +++ b/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilitiesInterpreter.scala @@ -24,7 +24,7 @@ class AbilitiesInterpreter[F[_], X](implicit getState.map(_.abilities.get(name)) override def apply[A](fa: AbilityOp[F, A]): State[X, A] = - (fa match { + fa match { case bs: BeginScope[F] => beginScope(AbilitiesState.Frame[F](bs.token)) @@ -145,5 +145,5 @@ class AbilitiesInterpreter[F[_], X](implicit ).as(true) } - }).asInstanceOf[State[X, A]] + } } diff --git a/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilityOp.scala b/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilityOp.scala index 8b166cd5..ef362d55 100644 --- a/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilityOp.scala +++ b/semantics/src/main/scala/aqua/semantics/rules/abilities/AbilityOp.scala @@ -27,4 +27,4 @@ case class GetServiceId[F[_]](name: Ability[F]) extends AbilityOp[F, Either[Bool case class BeginScope[F[_]](token: Token[F]) extends AbilityOp[F, Unit] -case class EndScope[F[_]]() extends AbilityOp[F, Boolean] +case class EndScope[F[_]]() extends AbilityOp[F, Unit] diff --git a/semantics/src/main/scala/aqua/semantics/rules/names/NamesInterpreter.scala b/semantics/src/main/scala/aqua/semantics/rules/names/NamesInterpreter.scala index 5845531a..e5966573 100644 --- a/semantics/src/main/scala/aqua/semantics/rules/names/NamesInterpreter.scala +++ b/semantics/src/main/scala/aqua/semantics/rules/names/NamesInterpreter.scala @@ -31,7 +31,7 @@ class NamesInterpreter[F[_], X](implicit lens: Lens[X, NamesState[F]], error: Re } override def apply[A](fa: NameOp[F, A]): State[X, A] = - (fa match { + fa match { case rn: ReadName[F] => OptionT(constantDefined(rn.name.value)) .orElseF(readName(rn.name.value)) @@ -107,5 +107,5 @@ class NamesInterpreter[F[_], X](implicit lens: Lens[X, NamesState[F]], error: Re beginScope(NamesState.Frame(bs.token)) case _: EndScope[F] => endScope - }).asInstanceOf[State[X, A]] + } }