Skip to content

Commit 99c73d3

Browse files
Stricten CollectibleType
1 parent af3fc24 commit 99c73d3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

types/src/main/scala/aqua/types/Type.scala

+7-4
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ object CollectionType {
330330
sealed trait ImmutableCollectionType extends CollectionType with DataType {
331331
def withElement(t: DataType): ImmutableCollectionType
332332
}
333+
333334
sealed trait MutableStreamType extends CollectionType {
334335
def toCanon: ImmutableCollectionType
335336
}
@@ -389,7 +390,7 @@ case class StreamMapType(override val element: DataType) extends MutableStreamTy
389390

390391
override def toString: String = s"%$element"
391392

392-
def getFunc(f: Func): ArrowType ={
393+
def getFunc(f: Func): ArrowType = {
393394
val (args, rets) = f match {
394395
case Get =>
395396
(ScalarType.string :: Nil) -> (ArrayType(element) :: Nil)
@@ -431,7 +432,7 @@ object StreamMapType {
431432
def funcByString(s: String): Option[Func] =
432433
Func.values.find(_.name == s)
433434

434-
lazy val allFuncs: List[Func] = Func.values.toList
435+
lazy val allFuncs: List[Func] = Func.values.toList
435436

436437
def top(): StreamMapType = StreamMapType(TopType)
437438
}
@@ -602,9 +603,11 @@ case class ArrowType(domain: ProductType, codomain: ProductType) extends Type {
602603
object Type {
603604

604605
/**
605-
* `StreamType` is collectible with canonicalization
606+
* `StreamType` is collectible with canonicalization.
607+
* Note: until aqua type system has immutable maps,
608+
* they are not collectible
606609
*/
607-
type CollectibleType = DataType | MutableStreamType
610+
type CollectibleType = DataType | StreamType
608611

609612
def isStreamType(t: Type): Boolean =
610613
t match {

0 commit comments

Comments
 (0)