Skip to content

Commit

Permalink
Fix two problems with Global Variable Usage rule.
Browse files Browse the repository at this point in the history
- The rule crashed on ByteArray
- The rule considered Traits as globals
  • Loading branch information
jecisc committed Nov 13, 2019
1 parent bbb812d commit 07cbbf7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/GeneralRules/RBGlobalVariablesUsage.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ RBGlobalVariablesUsage class >> checksMethod [
{ #category : #running }
RBGlobalVariablesUsage >> basicCheck: aMethod [
^ (aMethod literals
select: [ :l |
l isSymbol not
and: [ l isString not
and: [ l isNumber not
and: [ l isArray not
and: [ l isCharacter not
and: [ l isGlobalVariable ] ] ] ] ] ])
anySatisfy: [ :v | v value isClass not ]
select: [ :l | l isLiteral not and: [ l isGlobalVariable ] ])
noneSatisfy: [ :v | v value isClass or: [ v value isTrait ] ]
]

{ #category : #running }
Expand Down

0 comments on commit 07cbbf7

Please sign in to comment.