diff --git a/src/Soil-Core-Tests/SoilTest.class.st b/src/Soil-Core-Tests/SoilTest.class.st index a4d04e87..35bccc56 100644 --- a/src/Soil-Core-Tests/SoilTest.class.st +++ b/src/Soil-Core-Tests/SoilTest.class.st @@ -331,6 +331,32 @@ SoilTest >> testMigrationVersionsHalf [ ] +{ #category : #tests } +SoilTest >> testRootSendingClass [ + "We have a root in a Dictionary and that object overrides #= that checks using #class. + This tests that the proxy forwards #class correctly" + + | tx collection objectUsingClassinQueals | + tx := soil newTransaction. + collection := OrderedCollection new. + tx root: collection. + objectUsingClassinQueals := RBComment with: + (RBCommentToken + value: 'Some sample text' + start: 5 + stop: 21). + tx makeRoot: objectUsingClassinQueals. + collection add: objectUsingClassinQueals. + tx markDirty: objectUsingClassinQueals. + tx markDirty: collection. + tx commit. + + "now lets try to remove the object in a new transaction, note that the #remove uses #= which sends #class" + tx := soil newTransaction. + tx root remove: objectUsingClassinQueals. + tx commit +] + { #category : #tests } SoilTest >> testSerializingClassDescription [ | obj bytes obj2 stream transaction | diff --git a/src/Soil-Core/SoilObjectProxy.class.st b/src/Soil-Core/SoilObjectProxy.class.st index c796406a..1184d923 100644 --- a/src/Soil-Core/SoilObjectProxy.class.st +++ b/src/Soil-Core/SoilObjectProxy.class.st @@ -20,6 +20,12 @@ SoilObjectProxy >> asUnresolvedProxy [ objectId: objectId ] +{ #category : #'class membership' } +SoilObjectProxy >> class [ + "we override it here as else the superclass version would be uses, returning SoilObjectProxy" + ^ self soilRealObject class +] + { #category : #'reflective operations' } SoilObjectProxy >> doesNotUnderstand: aMessage [ ^ aMessage sendTo: self soilRealObject