diff --git a/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala b/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala index 248fabcf32b96..1a71a9a744bf6 100644 --- a/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala +++ b/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala @@ -246,7 +246,9 @@ case object TypeSignatures extends IRPass { private def resolveAscription(sig: Type.Ascription): Expression = { val newTyped = sig.typed.mapExpressions(resolveExpression) val newSig = sig.signature.mapExpressions(resolveExpression) - newTyped.updateMetadata(new MetadataPair(this, Signature(newSig, sig.comment))) + newTyped.updateMetadata( + new MetadataPair(this, Signature(newSig, sig.comment)) + ) } /** Resolves type signatures in a block. @@ -322,7 +324,8 @@ case object TypeSignatures extends IRPass { * * @param signature the expression for the type signature */ - case class Signature(signature: Expression, comment: Option[String] = None) extends IRPass.IRMetadata { + case class Signature(signature: Expression, comment: Option[String] = None) + extends IRPass.IRMetadata { override val metadataName: String = "TypeSignatures.Signature" /** @inheritdoc */ diff --git a/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Type.scala b/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Type.scala index 775f4948544a2..28c94690e48ab 100644 --- a/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Type.scala +++ b/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Type.scala @@ -119,24 +119,24 @@ object Type { } /** The ascription of a type to a value. - * - * @param typed the expression being ascribed a type - * @param signature the signature being ascribed to `typed` - * @param comment a comment that may be used to add context to the type error - * @param location the source location that the node corresponds to - * @param passData the pass metadata associated with this node - * @param diagnostics compiler diagnostics for this node - */ + * + * @param typed the expression being ascribed a type + * @param signature the signature being ascribed to `typed` + * @param comment a comment that may be used to add context to the type error + * @param location the source location that the node corresponds to + * @param passData the pass metadata associated with this node + * @param diagnostics compiler diagnostics for this node + */ sealed case class Ascription( typed: Expression, signature: Expression, comment: Option[String], override val location: Option[IdentifiedLocation], - override val passData: MetadataStorage = new MetadataStorage(), + override val passData: MetadataStorage = new MetadataStorage(), override val diagnostics: DiagnosticStorage = DiagnosticStorage() ) extends Type - with module.scope.Definition - with IRKind.Primitive { + with module.scope.Definition + with IRKind.Primitive { var id: UUID @Identifier = randomId /** Creates a copy of `this`. @@ -153,13 +153,14 @@ object Type { def copy( typed: Expression = typed, signature: Expression = signature, - comment: Option[String] = comment, + comment: Option[String] = comment, location: Option[IdentifiedLocation] = location, passData: MetadataStorage = passData, diagnostics: DiagnosticStorage = diagnostics, id: UUID @Identifier = id ): Ascription = { - val res = Ascription(typed, signature, comment, location, passData, diagnostics) + val res = + Ascription(typed, signature, comment, location, passData, diagnostics) res.id = id res } diff --git a/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala b/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala index db962bc451ca9..aa2bd354a9e53 100644 --- a/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala +++ b/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala @@ -712,7 +712,10 @@ class IrToTruffle( // === Utility Functions ==================================================== // ========================================================================== - private def extractAscribedType(comment: String, t: Expression): ReadArgumentCheckNode = t match { + private def extractAscribedType( + comment: String, + t: Expression + ): ReadArgumentCheckNode = t match { case u: `type`.Set.Union => ReadArgumentCheckNode.oneOf( comment, @@ -1072,9 +1075,11 @@ class IrToTruffle( ir match { case _: Expression.Binding => case _ => - val types: Option[TypeSignatures.Signature] = ir.getMetadata(TypeSignatures) + val types: Option[TypeSignatures.Signature] = + ir.getMetadata(TypeSignatures) types.foreach { tpe => - val checkNode = extractAscribedType(tpe.comment.orNull, tpe.signature); + val checkNode = + extractAscribedType(tpe.comment.orNull, tpe.signature); if (checkNode != null) { runtimeExpression = ReadArgumentCheckNode.wrap(runtimeExpression, checkNode)