Let's say I have the following action which does at first a read operation and then updates the fields.
action1: DBIOAction[Any, NoStream, Read with Write]
Let action2
do another read operation on the same table. To do the three operation sequentially I do the following:
val action3 = action1 andThen action2
So I presume the output should be of the format.
action3: DBIOAction[Any, NoStream, Read with Write with Read]
But when I see that the output is of the form again :
DBIOAction[Any, NoStream, Read with Write]
Indeed in the method's signature I wrote DBIOAction[Any, NoStream, Read with Write with Read]
but the IntelliJ does not complain. This does not seem correct. Am I doing a mistake ?
Read with Write with Read
andRead with Write
are mostly the same type:although according to the spec they seem to be not equivalent (≡):
Looking into compiler:
https://github.com/scala/scala/pull/3981
https://github.com/retronym/scala/blob/a9182fbeaf018c1aa0f88f0aee7b921383b746f2/src/reflect/scala/reflect/internal/Types.scala#L1601-L1619
Notice the usage of
flatten(...)
and.distinct
.