# .multi. 402-2-no-warnings-multi.cobra class X var _count =0 var rCount =0 sig BumpEventHandler(sender as Object, args as EventArgs) event bumpEvent as BumpEventHandler def _onBumpEvent(args as EventArgs) raise .bumpEvent, this, args # .no-warnings. warning:implied this def bump _count += 1 if _count % 10 == 0 ev = EventArgs() _onBumpEvent(ev) assert this.rCount # .no-warnings. warning:unnecessary this literal # commented out code #.foo.bar # .foo.bar # .foo.bar #.foo.bar # .foo.bar # .foo.bar def doBump(source as Object, eArgs as EventArgs) .rCount += 1 def main is shared, shared #.no-warnings. warning:duplicate modifier e = X() listen e.bumpEvent, ref e.doBump for i in 20 e.bump assert e.rCount == 2 j=99 # .no-warnings. warning: never used a = 99 if (a < 10) # .no-warnings. warning: Unnecessary parens a=10 assert a is 99 #.no-warnings. warning:value Types assert a is not 100 #.no-warnings. warning:value Types s='string' t = s to String # .no-warnings. warning:redundant typecast t1 = s to String? # .no-warnings. warning:just use to ?