class FooAttribute inherits Attribute cue init .init(0) cue init(value as int) base.init _value = value pro value from var as int class Test def bar1 has return Foo pass def bar2 has Foo pass def main for method in .typeOf.getMethods if method.name.startsWith('Bar') customAttrs = method.getCustomAttributes(true) returnAttrs = method.returnParameter.getCustomAttributes(true) branch method.name on 'Bar1' assert customAttrs.length == 0 assert returnAttrs.length == 1 and returnAttrs[0] inherits FooAttribute on 'Bar2' assert customAttrs.length == 1 and customAttrs[0] inherits FooAttribute assert returnAttrs.length == 0