Reputation: 13
I try to create a query to get all methods with a specific return type. Looking at the definitions of FAMIXMethod
and FAMIXBehavioralEntity
I think the declaredType: is the correct method for this query on FAMIXMethodGroup
.
I've tried to use the query:
self select: [ :each | each declaredType: String ]
But this stops with an
error: "MessageNotUnderstood"
Upvotes: 1
Views: 108
Reputation: 10217
declaredType:
is a setter, so you are trying to change the declaredType, which is expected to be a FAMIXType
. Thus the MessageNotUnderstood.
A possible approach is to get the declaredType (which is a (sub)instance of FAMIXType
) and ask for the smalltalkClass
. Note that declaredType may not exist.
self select: [ :each |
each hasDeclaredType and: [
each declaredType smalltalkClass isKindOf: String class ] ].
Maybe a simpler approach can be devised with Moose Query, but I am not familiar with that.
Upvotes: 1