Files
codeql/csharp/ql/test/library-tests/attributes/PrintAst.expected
2024-09-16 10:57:25 +02:00

482 lines
19 KiB
Plaintext

attributes.cs:
# 11| [AssemblyAttribute] [assembly: AssemblyTitle(...)]
# 11| -1: [TypeMention] AssemblyTitleAttribute
# 11| 0: [StringLiteralUtf16] "C# attributes test"
# 12| [AssemblyAttribute] [assembly: AssemblyDescription(...)]
# 12| -1: [TypeMention] AssemblyDescriptionAttribute
# 12| 0: [StringLiteralUtf16] "A test of C# attributes"
# 13| [AssemblyAttribute] [assembly: AssemblyConfiguration(...)]
# 13| -1: [TypeMention] AssemblyConfigurationAttribute
# 13| 0: [StringLiteralUtf16] ""
# 14| [AssemblyAttribute] [assembly: AssemblyCompany(...)]
# 14| -1: [TypeMention] AssemblyCompanyAttribute
# 14| 0: [StringLiteralUtf16] "Semmle Plc"
# 15| [AssemblyAttribute] [assembly: AssemblyProduct(...)]
# 15| -1: [TypeMention] AssemblyProductAttribute
# 15| 0: [StringLiteralUtf16] "Odasa"
# 16| [AssemblyAttribute] [assembly: AssemblyCopyright(...)]
# 16| -1: [TypeMention] AssemblyCopyrightAttribute
# 16| 0: [StringLiteralUtf16] "Copyright © Semmle 2018"
# 17| [AssemblyAttribute] [assembly: AssemblyTrademark(...)]
# 17| -1: [TypeMention] AssemblyTrademarkAttribute
# 17| 0: [StringLiteralUtf16] ""
# 18| [AssemblyAttribute] [assembly: AssemblyCulture(...)]
# 18| -1: [TypeMention] AssemblyCultureAttribute
# 18| 0: [StringLiteralUtf16] ""
# 23| [AssemblyAttribute] [assembly: ComVisible(...)]
# 23| -1: [TypeMention] ComVisibleAttribute
# 23| 0: [BoolLiteral] false
# 26| [AssemblyAttribute] [assembly: Guid(...)]
# 26| -1: [TypeMention] GuidAttribute
# 26| 0: [StringLiteralUtf16] "2f70fdd6-14aa-4850-b053-d547adb1f476"
# 38| [AssemblyAttribute] [assembly: AssemblyVersion(...)]
# 38| -1: [TypeMention] AssemblyVersionAttribute
# 38| 0: [StringLiteralUtf16] "1.0.0.0"
# 39| [AssemblyAttribute] [assembly: AssemblyFileVersion(...)]
# 39| -1: [TypeMention] AssemblyFileVersionAttribute
# 39| 0: [StringLiteralUtf16] "1.0.0.0"
# 41| [AssemblyAttribute] [assembly: Args(...)]
# 41| -1: [TypeMention] ArgsAttribute
# 41| 0: [IntLiteral] 0
# 41| 1: [ArrayCreation] array creation of type Object[]
# 41| -2: [TypeMention] Object[]
# 41| 1: [TypeMention] object
# 41| -1: [ArrayInitializer] { ..., ... }
# 41| 0: [CastExpr] (...) ...
# 41| 1: [IntLiteral] 1
# 41| 1: [CastExpr] (...) ...
# 41| 1: [IntLiteral] 2
# 41| 2: [NullLiteral] null
# 41| 2: [TypeofExpr] typeof(...)
# 41| 0: [TypeAccess] access to type ArgsAttribute
# 41| 0: [TypeMention] ArgsAttribute
# 41| 3: [CastExpr] (...) ...
# 41| 0: [TypeAccess] access to type E
# 41| 0: [TypeMention] E
# 41| 1: [IntLiteral] 12
# 41| 4: [NullLiteral] null
# 41| 5: [ArrayCreation] array creation of type Object[]
# 41| -2: [TypeMention] Object[]
# 41| 1: [TypeMention] object
# 41| -1: [ArrayInitializer] { ..., ... }
# 41| 0: [CastExpr] (...) ...
# 41| 1: [IntLiteral] 1
# 41| 1: [TypeofExpr] typeof(...)
# 41| 0: [TypeAccess] access to type Int32
# 41| 0: [TypeMention] int
# 42| [ModuleAttribute] [module: Args(...)]
# 42| -1: [TypeMention] ArgsAttribute
# 42| 0: [IntLiteral] 0
# 42| 1: [ArrayCreation] array creation of type Object[]
# 42| -2: [TypeMention] Object[]
# 42| 1: [TypeMention] object
# 42| -1: [ArrayInitializer] { ..., ... }
# 42| 0: [CastExpr] (...) ...
# 42| 1: [IntLiteral] 1
# 42| 1: [CastExpr] (...) ...
# 42| 1: [IntLiteral] 2
# 42| 2: [NullLiteral] null
# 42| 2: [TypeofExpr] typeof(...)
# 42| 0: [TypeAccess] access to type ArgsAttribute
# 42| 0: [TypeMention] ArgsAttribute
# 42| 3: [CastExpr] (...) ...
# 42| 0: [TypeAccess] access to type E
# 42| 0: [TypeMention] E
# 42| 1: [IntLiteral] 12
# 42| 4: [NullLiteral] null
# 42| 5: [ArrayCreation] array creation of type Object[]
# 42| -2: [TypeMention] Object[]
# 42| 1: [TypeMention] object
# 42| -1: [ArrayInitializer] { ..., ... }
# 42| 0: [CastExpr] (...) ...
# 42| 1: [IntLiteral] 1
# 42| 1: [TypeofExpr] typeof(...)
# 42| 0: [TypeAccess] access to type Int32
# 42| 0: [TypeMention] int
# 45| [Class] Foo
#-----| 0: (Attributes)
# 44| 1: [DefaultAttribute] [AttributeUsage(...)]
# 44| -1: [TypeMention] AttributeUsageAttribute
# 44| 0: [MemberConstantAccess] access to constant All
# 44| -1: [TypeAccess] access to type AttributeTargets
# 44| 0: [TypeMention] AttributeTargets
#-----| 3: (Base types)
# 45| 0: [TypeMention] Attribute
# 48| 5: [Method] foo
# 48| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 47| 1: [DefaultAttribute] [Conditional(...)]
# 47| -1: [TypeMention] ConditionalAttribute
# 47| 0: [StringLiteralUtf16] "DEBUG2"
# 48| 4: [BlockStmt] {...}
# 51| [Class] Bar
# 53| 5: [Method] inc
# 53| -1: [TypeMention] int
#-----| 2: (Parameters)
# 53| 0: [Parameter] x
# 53| -1: [TypeMention] int
#-----| 0: (Attributes)
# 53| 1: [DefaultAttribute] [Foo(...)]
# 53| 0: [TypeMention] Foo
# 53| 4: [BlockStmt] {...}
# 53| 0: [ReturnStmt] return ...;
# 53| 0: [AddExpr] ... + ...
# 53| 0: [ParameterAccess] access to parameter x
# 53| 1: [IntLiteral] 1
# 56| 6: [Method] M1
# 56| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 55| 1: [DefaultAttribute] [My(...)]
# 55| -1: [TypeMention] MyAttribute
# 55| 0: [BoolLiteral] false
# 56| 4: [BlockStmt] {...}
# 60| 7: [Method] M2
# 60| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 58| 1: [DefaultAttribute] [My(...)]
# 58| -1: [TypeMention] MyAttribute
# 58| 0: [BoolLiteral] true
# 58| 1: [StringLiteralUtf16] ""
# 58| 2: [IntLiteral] 0
# 59| 2: [DefaultAttribute] [My2(...)]
# 59| -1: [TypeMention] My2Attribute
# 59| 0: [BoolLiteral] false
# 59| 1: [BoolLiteral] true
# 59| 3: [IntLiteral] 1
# 59| 4: [IntLiteral] 42
# 60| 4: [BlockStmt] {...}
# 63| [Class] MyAttribute
#-----| 3: (Base types)
# 63| 0: [TypeMention] Attribute
# 65| 4: [Field] x
# 65| -1: [TypeMention] int
# 66| 5: [Property] y
# 66| -1: [TypeMention] string
# 66| 3: [Getter] get_y
# 66| 4: [Setter] set_y
#-----| 2: (Parameters)
# 66| 0: [Parameter] value
# 67| 6: [InstanceConstructor] MyAttribute
#-----| 2: (Parameters)
# 67| 0: [Parameter] b
# 67| -1: [TypeMention] bool
# 67| 4: [BlockStmt] {...}
# 70| [Enum] E
# 70| 5: [Field] A
# 70| 1: [IntLiteral] 42
# 72| [Class] ArgsAttribute
#-----| 3: (Base types)
# 72| 0: [TypeMention] Attribute
# 74| 4: [Property] Prop
# 74| -1: [TypeMention] Object[]
# 74| 1: [TypeMention] object
# 74| 3: [Getter] get_Prop
# 74| 4: [Setter] set_Prop
#-----| 2: (Parameters)
# 74| 0: [Parameter] value
# 75| 5: [InstanceConstructor] ArgsAttribute
#-----| 2: (Parameters)
# 75| 0: [Parameter] i
# 75| -1: [TypeMention] int
# 75| 1: [Parameter] o
# 75| -1: [TypeMention] object
# 75| 2: [Parameter] t
# 75| -1: [TypeMention] Type
# 75| 3: [Parameter] e
# 75| -1: [TypeMention] E
# 75| 4: [Parameter] arr
# 75| -1: [TypeMention] Int32[]
# 75| 1: [TypeMention] int
# 75| 4: [BlockStmt] {...}
# 79| [Class] X
#-----| 0: (Attributes)
# 78| 1: [DefaultAttribute] [Args(...)]
# 78| -1: [TypeMention] ArgsAttribute
# 78| 0: [IntLiteral] 42
# 78| 1: [NullLiteral] null
# 78| 2: [TypeofExpr] typeof(...)
# 78| 0: [TypeAccess] access to type X
# 78| 0: [TypeMention] X
# 78| 3: [MemberConstantAccess] access to constant A
# 78| -1: [TypeAccess] access to type E
# 78| 0: [TypeMention] E
# 78| 4: [ArrayCreation] array creation of type Int32[]
# 78| -2: [TypeMention] Int32[]
# 78| 1: [TypeMention] int
# 78| -1: [ArrayInitializer] { ..., ... }
# 78| 0: [IntLiteral] 1
# 78| 1: [IntLiteral] 2
# 78| 2: [IntLiteral] 3
# 78| 5: [ArrayCreation] array creation of type Object[]
# 78| -2: [TypeMention] Object[]
# 78| 1: [TypeMention] object
# 78| -1: [ArrayInitializer] { ..., ... }
# 78| 0: [CastExpr] (...) ...
# 78| 1: [IntLiteral] 1
# 78| 1: [TypeofExpr] typeof(...)
# 78| 0: [TypeAccess] access to type Int32
# 78| 0: [TypeMention] int
# 83| 5: [Method] SomeMethod
# 83| -1: [TypeMention] int
#-----| 0: (Attributes)
# 81| 1: [DefaultAttribute] [Args(...)]
# 81| -1: [TypeMention] ArgsAttribute
# 81| 0: [AddExpr] ... + ...
# 81| 0: [IntLiteral] 42
# 81| 1: [IntLiteral] 0
# 81| 1: [ArrayCreation] array creation of type Int32[]
# 81| -2: [TypeMention] Int32[]
# 81| 1: [TypeMention] int
# 81| -1: [ArrayInitializer] { ..., ... }
# 81| 0: [IntLiteral] 1
# 81| 1: [IntLiteral] 2
# 81| 2: [IntLiteral] 3
# 81| 2: [NullLiteral] null
# 81| 3: [CastExpr] (...) ...
# 81| 0: [TypeAccess] access to type E
# 81| 0: [TypeMention] E
# 81| 1: [IntLiteral] 12
# 81| 4: [NullLiteral] null
# 81| 5: [ArrayCreation] array creation of type Object[]
# 81| -2: [TypeMention] Object[]
# 81| 1: [TypeMention] object
# 81| -1: [ArrayInitializer] { ..., ... }
# 81| 0: [CastExpr] (...) ...
# 81| 1: [IntLiteral] 1
# 81| 1: [TypeofExpr] typeof(...)
# 81| 0: [TypeAccess] access to type Int32
# 81| 0: [TypeMention] int
# 82| 2: [ReturnAttribute] [return: Args(...)]
# 82| -1: [TypeMention] ArgsAttribute
# 82| 0: [AddExpr] ... + ...
# 82| 0: [IntLiteral] 42
# 82| 1: [IntLiteral] 0
# 82| 1: [ArrayCreation] array creation of type Int32[]
# 82| -2: [TypeMention] Int32[]
# 82| 1: [TypeMention] int
# 82| -1: [ArrayInitializer] { ..., ... }
# 82| 0: [IntLiteral] 1
# 82| 1: [IntLiteral] 2
# 82| 2: [IntLiteral] 3
# 82| 2: [NullLiteral] null
# 82| 3: [CastExpr] (...) ...
# 82| 0: [TypeAccess] access to type E
# 82| 0: [TypeMention] E
# 82| 1: [IntLiteral] 12
# 82| 4: [NullLiteral] null
# 82| 5: [ArrayCreation] array creation of type Object[]
# 82| -2: [TypeMention] Object[]
# 82| 1: [TypeMention] object
# 82| -1: [ArrayInitializer] { ..., ... }
# 82| 0: [CastExpr] (...) ...
# 82| 1: [IntLiteral] 1
# 82| 1: [TypeofExpr] typeof(...)
# 82| 0: [TypeAccess] access to type Int32
# 82| 0: [TypeMention] int
# 83| 4: [BlockStmt] {...}
# 83| 0: [ReturnStmt] return ...;
# 83| 0: [IntLiteral] 1
# 86| [Class] My2Attribute
#-----| 3: (Base types)
# 86| 0: [TypeMention] Attribute
# 88| 4: [Property] X
# 88| -1: [TypeMention] int
# 88| 3: [Getter] get_X
# 88| 4: [Setter] set_X
#-----| 2: (Parameters)
# 88| 0: [Parameter] value
# 89| 5: [InstanceConstructor] My2Attribute
#-----| 2: (Parameters)
# 89| 0: [Parameter] a
# 89| -1: [TypeMention] bool
# 89| 1: [Parameter] b
# 89| -1: [TypeMention] bool
# 89| 2: [Parameter] i
# 89| -1: [TypeMention] int
# 89| 1: [IntLiteral] 12
# 89| 3: [Parameter] j
# 89| -1: [TypeMention] int
# 89| 1: [IntLiteral] 13
# 89| 4: [BlockStmt] {...}
# 92| [Class] My3Attribute
#-----| 3: (Base types)
# 92| 0: [TypeMention] Attribute
# 94| 4: [InstanceConstructor] My3Attribute
#-----| 2: (Parameters)
# 94| 0: [Parameter] x
# 94| -1: [TypeMention] int
# 94| 4: [BlockStmt] {...}
# 99| [DelegateType] My1Delegate
#-----| 0: (Attributes)
# 97| 1: [DefaultAttribute] [My3(...)]
# 97| -1: [TypeMention] My3Attribute
# 97| 0: [IntLiteral] 1
#-----| 2: (Parameters)
# 99| 0: [Parameter] message
# 99| -1: [TypeMention] string
# 103| [DelegateType] My2Delegate
#-----| 0: (Attributes)
# 102| 1: [DefaultAttribute] [My3(...)]
# 102| -1: [TypeMention] My3Attribute
# 102| 0: [IntLiteral] 4
#-----| 2: (Parameters)
# 103| 0: [Parameter] message
# 103| -1: [TypeMention] string
# 105| [Class] MyAttributeUsage
# 109| 5: [AddOperator] +
# 109| -1: [TypeMention] int
#-----| 0: (Attributes)
# 107| 1: [DefaultAttribute] [My3(...)]
# 107| -1: [TypeMention] My3Attribute
# 107| 0: [IntLiteral] 5
# 108| 2: [ReturnAttribute] [return: My3(...)]
# 108| -1: [TypeMention] My3Attribute
# 108| 0: [IntLiteral] 6
#-----| 2: (Parameters)
# 109| 0: [Parameter] a
# 109| -1: [TypeMention] MyAttributeUsage
# 109| 1: [Parameter] b
# 109| -1: [TypeMention] MyAttributeUsage
# 109| 4: [IntLiteral] 0
# 112| 6: [Indexer] Item
# 112| -1: [TypeMention] int
#-----| 0: (Attributes)
# 111| 1: [DefaultAttribute] [My3(...)]
# 111| -1: [TypeMention] My3Attribute
# 111| 0: [IntLiteral] 15
#-----| 1: (Parameters)
# 112| 0: [Parameter] x
# 112| -1: [TypeMention] int
# 116| 3: [Getter] get_Item
#-----| 0: (Attributes)
# 114| 1: [DefaultAttribute] [My3(...)]
# 114| -1: [TypeMention] My3Attribute
# 114| 0: [IntLiteral] 7
# 115| 2: [ReturnAttribute] [return: My3(...)]
# 115| -1: [TypeMention] My3Attribute
# 115| 0: [IntLiteral] 8
#-----| 2: (Parameters)
# 112| 0: [Parameter] x
# 116| 4: [BlockStmt] {...}
# 116| 0: [ReturnStmt] return ...;
# 116| 0: [AddExpr] ... + ...
# 116| 0: [ParameterAccess] access to parameter x
# 116| 1: [IntLiteral] 1
# 120| 4: [Setter] set_Item
#-----| 0: (Attributes)
# 118| 1: [DefaultAttribute] [My3(...)]
# 118| -1: [TypeMention] My3Attribute
# 118| 0: [IntLiteral] 9
#-----| 2: (Parameters)
# 112| 0: [Parameter] x
# 120| 1: [Parameter] value
#-----| 0: (Attributes)
# 119| 1: [DefaultAttribute] [My3(...)]
# 119| -1: [TypeMention] My3Attribute
# 119| 0: [IntLiteral] 10
# 120| 4: [BlockStmt] {...}
# 120| 0: [ReturnStmt] return ...;
# 123| 7: [Field] p
# 123| -1: [TypeMention] int
# 125| 8: [Property] Prop1
# 125| -1: [TypeMention] int
#-----| 0: (Attributes)
# 124| 1: [DefaultAttribute] [My3(...)]
# 124| -1: [TypeMention] My3Attribute
# 124| 0: [IntLiteral] 16
# 129| 3: [Getter] get_Prop1
#-----| 0: (Attributes)
# 127| 1: [DefaultAttribute] [My3(...)]
# 127| -1: [TypeMention] My3Attribute
# 127| 0: [IntLiteral] 11
# 128| 2: [ReturnAttribute] [return: My3(...)]
# 128| -1: [TypeMention] My3Attribute
# 128| 0: [IntLiteral] 12
# 129| 4: [BlockStmt] {...}
# 129| 0: [ReturnStmt] return ...;
# 129| 0: [FieldAccess] access to field p
# 133| 4: [Setter] set_Prop1
#-----| 0: (Attributes)
# 131| 1: [DefaultAttribute] [My3(...)]
# 131| -1: [TypeMention] My3Attribute
# 131| 0: [IntLiteral] 13
#-----| 2: (Parameters)
# 133| 0: [Parameter] value
#-----| 0: (Attributes)
# 132| 1: [DefaultAttribute] [My3(...)]
# 132| -1: [TypeMention] My3Attribute
# 132| 0: [IntLiteral] 14
# 133| 4: [BlockStmt] {...}
# 133| 0: [ExprStmt] ...;
# 133| 0: [AssignExpr] ... = ...
# 133| 0: [FieldAccess] access to field p
# 133| 1: [ParameterAccess] access to parameter value
# 137| [Class] Class1
# 139| 5: [Class] ParamsAttribute
#-----| 3: (Base types)
# 139| 0: [TypeMention] Attribute
# 141| 4: [InstanceConstructor] ParamsAttribute
#-----| 2: (Parameters)
# 141| 0: [Parameter] s1
# 141| -1: [TypeMention] string
# 141| 1: [Parameter] s2
# 141| -1: [TypeMention] string
# 141| 2: [Parameter] args
# 141| -1: [TypeMention] Int32[]
# 141| 1: [TypeMention] int
# 141| 4: [BlockStmt] {...}
# 145| 6: [Method] M1
# 145| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 144| 1: [DefaultAttribute] [Params(...)]
# 144| -1: [TypeMention] ParamsAttribute
# 144| 0: [StringLiteralUtf16] "a"
# 144| 1: [StringLiteralUtf16] "b"
# 144| 2: [IntLiteral] 1
# 144| 3: [IntLiteral] 2
# 144| 4: [IntLiteral] 3
# 145| 4: [BlockStmt] {...}
# 148| 7: [Method] M2
# 148| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 147| 1: [DefaultAttribute] [Params(...)]
# 147| -1: [TypeMention] ParamsAttribute
# 147| 0: [StringLiteralUtf16] "a"
# 147| 1: [StringLiteralUtf16] "b"
# 147| 2: [IntLiteral] 1
# 147| 3: [IntLiteral] 2
# 147| 4: [IntLiteral] 3
# 148| 4: [BlockStmt] {...}
# 151| 8: [Method] M3
# 151| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 150| 1: [DefaultAttribute] [Params(...)]
# 150| -1: [TypeMention] ParamsAttribute
# 150| 0: [StringLiteralUtf16] "a"
# 150| 1: [StringLiteralUtf16] "b"
# 150| 2: [IntLiteral] 1
# 151| 4: [BlockStmt] {...}
# 154| 9: [Method] M4
# 154| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 153| 1: [DefaultAttribute] [Params(...)]
# 153| -1: [TypeMention] ParamsAttribute
# 153| 0: [StringLiteralUtf16] "a"
# 153| 1: [StringLiteralUtf16] "b"
# 153| 2: [ArrayCreation] array creation of type Int32[]
# 153| -1: [ArrayInitializer] { ..., ... }
# 153| 0: [IntLiteral] 1
# 154| 4: [BlockStmt] {...}
# 158| [Class] MyExperimentalClass
#-----| 0: (Attributes)
# 157| 1: [DefaultAttribute] [Experimental(...)]
# 157| -1: [TypeMention] ExperimentalAttribute
# 157| 0: [StringLiteralUtf16] "MyExperimentalClassId"
# 161| 5: [Method] MyExperimentalMethod
# 161| -1: [TypeMention] Void
#-----| 0: (Attributes)
# 160| 1: [DefaultAttribute] [Experimental(...)]
# 160| -1: [TypeMention] ExperimentalAttribute
# 160| 0: [StringLiteralUtf16] "MyExperimentalMethodId"
# 161| 4: [BlockStmt] {...}