Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static VariableDeclaration Create(Context cx, ISymbol symbol, AnnotatedTy
var l = LocalVariable.Create(cx, symbol);
l.PopulateManual(ret, isVar);
if (optionalSyntax != null)
TypeMention.Create(cx, optionalSyntax, parent, type);
TypeMention.Create(cx, optionalSyntax, ret, type);
});
return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions csharp/ql/test/experimental/ir/ir/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ foreach.cs:
# 5| 5: [IntLiteral] 6
# 5| 6: [IntLiteral] 7
# 7| 1: [ForeachStmt] foreach (... ... in ...) ...
# 7| -1: [TypeMention] int
# 7| 0: [LocalVariableDeclExpr] Int32 items
# 7| 0: [TypeMention] int
# 7| 1: [LocalVariableAccess] access to local variable a_array
# 8| 2: [BlockStmt] {...}
# 9| 0: [LocalVariableDeclStmt] ... ...;
Expand Down Expand Up @@ -725,9 +725,9 @@ isexpr.cs:
# 12| 1: [LocalVariableAccess] access to local variable obj
# 13| 2: [IfStmt] if (...) ...
# 13| 0: [IsExpr] ... is ...
# 13| -1: [TypeMention] Is_A
# 13| 0: [LocalVariableAccess] access to local variable o
# 13| 1: [VariablePatternExpr] Is_A tmp
# 13| 0: [TypeMention] Is_A
# 14| 1: [BlockStmt] {...}
# 15| 0: [LocalVariableDeclStmt] ... ...;
# 15| 0: [LocalVariableDeclAndInitExpr] Int32 res = ...
Expand Down
14 changes: 7 additions & 7 deletions csharp/ql/test/library-tests/csharp7/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ CSharp7.cs:
# 235| 1: [IfStmt] if (...) ...
# 235| 0: [LogicalAndExpr] ... && ...
# 235| 0: [IsExpr] ... is ...
# 235| -1: [TypeMention] int
# 235| 0: [LocalVariableAccess] access to local variable o
# 235| 1: [VariablePatternExpr] Int32 i1
# 235| 0: [TypeMention] int
# 235| 1: [GTExpr] ... > ...
# 235| 0: [LocalVariableAccess] access to local variable i1
# 235| 1: [IntLiteral] 0
Expand All @@ -738,9 +738,9 @@ CSharp7.cs:
# 237| 1: [LocalVariableAccess] access to local variable i1
# 239| 2: [IfStmt] if (...) ...
# 239| 0: [IsExpr] ... is ...
# 239| -1: [TypeMention] string
# 239| 0: [LocalVariableAccess] access to local variable o
# 239| 1: [VariablePatternExpr] String s1
# 239| 0: [TypeMention] string
# 240| 1: [BlockStmt] {...}
# 241| 0: [ExprStmt] ...;
# 241| 0: [MethodCall] call to method WriteLine
Expand Down Expand Up @@ -774,9 +774,9 @@ CSharp7.cs:
# 256| 4: [ConstCase] case ...:
# 256| 0: [ConstantPatternExpr,StringLiteral] "x"
# 256| 1: [IsExpr] ... is ...
# 256| -1: [TypeMention] string
# 256| 0: [LocalVariableAccess] access to local variable o
# 256| 1: [VariablePatternExpr] String s4
# 256| 0: [TypeMention] string
# 257| 5: [ExprStmt] ...;
# 257| 0: [MethodCall] call to method WriteLine
# 257| -1: [TypeAccess] access to type Console
Expand All @@ -786,8 +786,8 @@ CSharp7.cs:
# 257| 1: [LocalVariableAccess] access to local variable s4
# 258| 6: [BreakStmt] break;
# 259| 7: [CaseStmt] case ...:
# 259| -1: [TypeMention] int
# 259| 0: [VariablePatternExpr] Int32 i2
# 259| 0: [TypeMention] int
# 259| 1: [GTExpr] ... > ...
# 259| 0: [LocalVariableAccess] access to local variable i2
# 259| 1: [IntLiteral] 0
Expand All @@ -800,8 +800,8 @@ CSharp7.cs:
# 260| 1: [LocalVariableAccess] access to local variable i2
# 261| 9: [BreakStmt] break;
# 262| 10: [CaseStmt] case ...:
# 262| -1: [TypeMention] int
# 262| 0: [VariablePatternExpr] Int32 i3
# 262| 0: [TypeMention] int
# 263| 11: [ExprStmt] ...;
# 263| 0: [MethodCall] call to method WriteLine
# 263| -1: [TypeAccess] access to type Console
Expand All @@ -811,8 +811,8 @@ CSharp7.cs:
# 263| 1: [LocalVariableAccess] access to local variable i3
# 264| 12: [BreakStmt] break;
# 265| 13: [CaseStmt] case ...:
# 265| -1: [TypeMention] string
# 265| 0: [VariablePatternExpr] String s2
# 265| 0: [TypeMention] string
# 266| 14: [ExprStmt] ...;
# 266| 0: [MethodCall] call to method WriteLine
# 266| -1: [TypeAccess] access to type Console
Expand Down Expand Up @@ -898,9 +898,9 @@ CSharp7.cs:
# 299| 0: [LocalVariableAccess] access to local variable x
# 299| 1: [IntLiteral] 10
# 299| 1: [IsExpr] ... is ...
# 299| -1: [TypeMention] int
# 299| 0: [LocalVariableAccess] access to local variable x
# 299| 1: [VariablePatternExpr] Int32 y
# 299| 0: [TypeMention] int
# 299| 1: [PreIncrExpr] ++...
# 299| 0: [LocalVariableAccess] access to local variable x
# 300| 2: [BlockStmt] {...}
Expand Down
26 changes: 13 additions & 13 deletions csharp/ql/test/library-tests/csharp8/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ AsyncStreams.cs:
# 17| -1: [TypeMention] Void
# 18| 4: [BlockStmt] {...}
# 19| 0: [ForeachStmt] foreach (... ... in ...) ...
# 19| -1: [TypeMention] int
# 19| 0: [LocalVariableDeclExpr] Int32 item
# 19| 0: [TypeMention] int
# 19| 1: [MethodCall] call to method Items
# 20| 2: [ExprStmt] ...;
# 20| 0: [MethodCall] call to method WriteLine
Expand Down Expand Up @@ -744,9 +744,9 @@ patterns.cs:
# 7| 1: [IntLiteral] 2
# 9| 1: [IfStmt] if (...) ...
# 9| 0: [IsExpr] ... is ...
# 9| -1: [TypeMention] MyStruct
# 9| 0: [LocalVariableAccess] access to local variable o
# 9| 1: [VariablePatternExpr] MyStruct ms1
# 9| 0: [TypeMention] MyStruct
# 10| 1: [BlockStmt] {...}
# 13| 2: [IfStmt] if (...) ...
# 13| 0: [LogicalAndExpr] ... && ...
Expand All @@ -758,8 +758,8 @@ patterns.cs:
# 13| 1: [TypeAccess] access to type MyStruct
# 13| 0: [TypeMention] MyStruct
# 13| 3: [PropertyPatternExpr] { ... }
# 13| -1: [TypeMention] int
# 13| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x
# 13| 0: [TypeMention] int
# 13| 1: [LTExpr] ... < ...
# 13| 0: [LocalVariableAccess] access to local variable x
# 13| 1: [IntLiteral] 4
Expand Down Expand Up @@ -818,8 +818,8 @@ patterns.cs:
# 36| 1: [SwitchStmt] switch (...) {...}
# 36| 0: [LocalVariableAccess] access to local variable s
# 38| 0: [CaseStmt] case ...:
# 38| -1: [TypeMention] MyStruct
# 38| 0: [VariablePatternExpr] MyStruct ms1
# 38| 0: [TypeMention] MyStruct
# 38| 1: [EQExpr] ... == ...
# 38| 0: [FieldAccess] access to field X
# 38| -1: [LocalVariableAccess] access to local variable ms1
Expand All @@ -831,8 +831,8 @@ patterns.cs:
# 39| 0: [StringLiteral] "Hit the breakpoint"
# 40| 2: [BreakStmt] break;
# 41| 3: [CaseStmt] case ...:
# 41| -1: [TypeMention] MyStruct
# 41| 0: [VariablePatternExpr] MyStruct ms2
# 41| 0: [TypeMention] MyStruct
# 41| 1: [LTExpr] ... < ...
# 41| 0: [FieldAccess] access to field X
# 41| -1: [LocalVariableAccess] access to local variable ms2
Expand All @@ -850,8 +850,8 @@ patterns.cs:
# 48| 1: [TypeAccess] access to type MyStruct
# 48| 0: [TypeMention] MyStruct
# 48| 3: [PropertyPatternExpr] { ... }
# 48| -1: [TypeMention] int
# 48| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x
# 48| 0: [TypeMention] int
# 48| 1: [GTExpr] ... > ...
# 48| 0: [LocalVariableAccess] access to local variable x
# 48| 1: [IntLiteral] 2
Expand All @@ -877,8 +877,8 @@ patterns.cs:
# 54| 6: [CaseStmt] case ...:
# 54| 0: [RecursivePatternExpr] { ... }
# 54| 3: [PropertyPatternExpr] { ... }
# 54| -1: [TypeMention] int
# 54| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x2
# 54| 0: [TypeMention] int
# 54| 1: [GTExpr] ... > ...
# 54| 0: [LocalVariableAccess] access to local variable x2
# 54| 1: [IntLiteral] 2
Expand Down Expand Up @@ -908,8 +908,8 @@ patterns.cs:
# 67| 1: [TypeAccess] access to type MyStruct
# 67| 0: [TypeMention] MyStruct
# 67| 3: [PropertyPatternExpr] { ... }
# 67| -1: [TypeMention] int
# 67| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x
# 67| 0: [TypeMention] int
# 67| 1: [GTExpr] ... > ...
# 67| 0: [LocalVariableAccess] access to local variable x
# 67| 1: [IntLiteral] 2
Expand Down Expand Up @@ -942,10 +942,10 @@ patterns.cs:
# 78| 0: [CaseStmt] case ...:
# 78| 0: [RecursivePatternExpr] { ... }
# 78| 2: [PositionalPatternExpr] ( ... )
# 78| -1: [TypeMention] int
# 78| -1: [TypeMention] float
# 78| 0: [VariablePatternExpr] Int32 x
# 78| 0: [TypeMention] int
# 78| 1: [VariablePatternExpr] Single y
# 78| 0: [TypeMention] float
# 78| 1: [LTExpr] ... < ...
# 78| 0: [CastExpr] (...) ...
# 78| 1: [LocalVariableAccess] access to local variable x
Expand Down Expand Up @@ -998,8 +998,8 @@ patterns.cs:
# 100| 1: [SwitchExpr] ... switch { ... }
# 100| -1: [ParameterAccess] access to parameter x
# 101| 0: [SwitchCaseExpr] ... => ...
# 101| -1: [TypeMention] int
# 101| 0: [VariablePatternExpr] Int32 y
# 101| 0: [TypeMention] int
# 101| 1: [GTExpr] ... > ...
# 101| 0: [LocalVariableAccess] access to local variable y
# 101| 1: [IntLiteral] 10
Expand Down Expand Up @@ -1101,8 +1101,8 @@ patterns.cs:
# 128| 1: [TypeAccess] access to type MyStruct
# 128| 0: [TypeMention] MyStruct
# 128| 3: [PropertyPatternExpr] { ... }
# 128| -1: [TypeMention] int
# 128| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x
# 128| 0: [TypeMention] int
# 128| 1: [GTExpr] ... > ...
# 128| 0: [LocalVariableAccess] access to local variable x
# 128| 1: [IntLiteral] 2
Expand Down Expand Up @@ -1142,8 +1142,8 @@ patterns.cs:
# 139| 0: [ConstantPatternExpr,IntLiteral] 2
# 139| 2: [IntLiteral] 3
# 140| 2: [SwitchCaseExpr] ... => ...
# 140| -1: [TypeMention] object
# 140| 0: [VariablePatternExpr] Object y
# 140| 0: [TypeMention] object
# 140| 1: [IsExpr] ... is ...
# 140| 0: [LocalVariableAccess] access to local variable y
# 140| 1: [RecursivePatternExpr] { ... }
Expand Down
6 changes: 3 additions & 3 deletions csharp/ql/test/library-tests/definitions/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ definitions.cs:
# 86| 0: [TypeMention] Exception
# 87| 1: [BlockStmt] {...}
# 88| 0: [ForeachStmt] foreach (... ... in ...) ...
# 88| -1: [TypeMention] S1
# 88| 0: [LocalVariableDeclExpr] S1 s
# 88| 0: [TypeMention] S1
# 88| 1: [ParameterAccess] access to parameter ss
# 89| 2: [BlockStmt] {...}
# 92| 1: [LocalVariableDeclStmt] ... ...;
Expand Down Expand Up @@ -507,18 +507,18 @@ definitions.cs:
# 210| 1: [NullLiteral] null
# 211| 1: [IfStmt] if (...) ...
# 211| 0: [IsExpr] ... is ...
# 211| -1: [TypeMention] C8
# 211| 0: [LocalVariableAccess] access to local variable c8a
# 211| 1: [VariablePatternExpr] C8 c8b
# 211| 0: [TypeMention] C8
# 212| 1: [ExprStmt] ...;
# 212| 0: [AssignExpr] ... = ...
# 212| 0: [LocalVariableAccess] access to local variable c8a
# 212| 1: [LocalVariableAccess] access to local variable c8b
# 213| 2: [SwitchStmt] switch (...) {...}
# 213| 0: [LocalVariableAccess] access to local variable c8a
# 215| 0: [CaseStmt] case ...:
# 215| -1: [TypeMention] C8
# 215| 0: [VariablePatternExpr] C8 c8c
# 215| 0: [TypeMention] C8
# 215| 1: [NEExpr] ... != ...
# 215| 0: [LocalVariableAccess] access to local variable c8c
# 215| 1: [NullLiteral] null
Expand Down
4 changes: 2 additions & 2 deletions csharp/ql/test/library-tests/linq/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ queries.cs:
# 39| -1: [TypeMention] IEnumerable<Object>
# 39| 0: [LocalVariableAccess] access to local variable list8
# 41| 1: [MethodCall] call to method Select
# 40| -1: [TypeMention] object
# 40| 0: [LocalVariableDeclAndInitExpr] Object a = ...
# 40| -1: [TypeMention] object
# 40| 0: [LocalVariableAccess] access to local variable a
# 40| 1: [LocalVariableAccess] access to local variable list7
# 41| 1: [LocalVariableAccess] access to local variable a
Expand All @@ -176,8 +176,8 @@ queries.cs:
# 49| -1: [TypeMention] IEnumerable<String>
# 49| 0: [LocalVariableAccess] access to local variable list11
# 51| 1: [MethodCall] call to method Select
# 50| -1: [TypeMention] string
# 50| 0: [LocalVariableDeclAndInitExpr] String a = ...
# 50| -1: [TypeMention] string
# 50| 0: [LocalVariableAccess] access to local variable a
# 50| 1: [LocalVariableAccess] access to local variable list7
# 51| 1: [LocalVariableAccess] access to local variable a
Expand Down
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/methods/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ methods.cs:
# 126| 2: [StringLiteral] "333"
# 126| 3: [StringLiteral] "4444"
# 127| 1: [ForeachStmt] foreach (... ... in ...) ...
# 127| -1: [TypeMention] string
# 127| 0: [LocalVariableDeclExpr] String s
# 127| 0: [TypeMention] string
# 127| 1: [MethodCall] call to method Slice
# 127| -1: [LocalVariableAccess] access to local variable strings
# 127| 0: [IntLiteral] 1
Expand Down
4 changes: 2 additions & 2 deletions csharp/ql/test/library-tests/statements/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ statements.cs:
# 140| 1: [TypeMention] string
# 141| 4: [BlockStmt] {...}
# 142| 0: [ForeachStmt] foreach (... ... in ...) ...
# 142| -1: [TypeMention] string
# 142| 0: [LocalVariableDeclExpr] String s
# 142| 0: [TypeMention] string
# 142| 1: [ParameterAccess] access to parameter args
# 143| 2: [BlockStmt] {...}
# 144| 0: [ExprStmt] ...;
Expand Down Expand Up @@ -502,8 +502,8 @@ statements.cs:
# 193| -1: [TypeMention] Void
# 194| 4: [BlockStmt] {...}
# 195| 0: [ForeachStmt] foreach (... ... in ...) ...
# 195| -1: [TypeMention] int
# 195| 0: [LocalVariableDeclExpr] Int32 x
# 195| 0: [TypeMention] int
# 195| 1: [MethodCall] call to method Range
# 195| 0: [UnaryMinusExpr] -...
# 195| 0: [IntLiteral] 10
Expand Down