Weirdness with and without []: assignment of an object of class "numeric" is not valid for slot "values" in an object of class

The following indicates that assignment of numeric values to an @values part of an mxMatrix only works when the [] are there. When they are not there (which used to work fine) we get an error:

> DirectionofCausationBcausesA$ACE.B@values
[,1] [,2]
[1,] 0 0
[2,] 0 0
> DirectionofCausationBcausesA$ACE.B@values[]
[,1] [,2]
[1,] 0 0
[2,] 0 0
>
> DirectionofCausationBcausesA$ACE.B@values<-0
Error in checkSlotAssignment(object, name, value) :
assignment of an object of class "numeric" is not valid for slot "values" in an object of class "FullMatrix"; is(value, "matrix") is not TRUE
>
>
> DirectionofCausationBcausesA$ACE.B@values
[,1] [,2]
[1,] 0 0
[2,] 0 0
>
> DirectionofCausationBcausesA$ACE.B@values[]<-0

This is not a bug. The slots of a S4 object are typed objects. They are possibly the only objects in R that are typed objects. '0' is a numeric vector, while ACE.B@values expects a matrix type. Therefore the assignment ACE.B@values[] <- 0 is necessary.

An analogy would be:

foo <- matrix(1:9, 3, 3)
is.matrix(foo) # TRUE
foo <- 0
is.matrix(foo) # FALSE, oops
foo <- matrix(1:9, 3, 3)
foo[] <- 0
is.matrix(foo) # TRUE