Siegfried Pammer
3cc49044ec
Extend UseLambdaSyntax to emit statement lambdas
...
Under UseLambdaSyntax, anonymous functions became lambdas only when an
expression body was possible; statement-bodied ones kept C# 2 delegate
syntax. Now every anonymous function whose parameter shape a lambda can
express uses lambda syntax; delegate syntax remains for ref/out/in and
params parameters and for pre-C# 3 language profiles.
Two latent issues surfaced by the wider lambda coverage: DeclareVariables
assumed an insertion point directly under a LambdaExpression is an
expression body it must convert to a block, which block-bodied lambdas
now violate; and anonymous methods declared without a parameter list
carry compiler-generated parameter names like '<p0>' that are not valid
identifiers, so the lambda's mandatory parameter list regenerates such
names from the parameter type: (object obj, EventArgs e) => ...
A side effect visible in fixtures: an explicit parameter list can make
a delegate-creation cast redundant that bare 'delegate' syntax needed
for overload resolution, e.g. new Thread((ThreadStart)delegate { })
becomes new Thread(() => { }).
Assisted-by: Claude:claude-fable-5:Claude Code
1 month ago
Siegfried Pammer
f59b76a655
Add pretty test for checked arithmetic in expression trees
...
AddChecked/MultiplyChecked/ConvertChecked nodes were not covered;
they are pretty-printed as a checked block around the tree-building
calls.
Assisted-by: Claude:claude-fable-5:Claude Code
2 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
1 year ago
Siegfried Pammer
eae54ddf24
Fix #3014 : Missing type information in lambda expressions.
3 years ago
Siegfried Pammer
0bc11d05d3
Fix #2634 : target expressions of delegate references were not decompiled correctly
4 years ago
Siegfried Pammer
ba39dd5c55
Fix #2354 : decompilation of unary and binary operators with nullable value types.
5 years ago
Siegfried Pammer
3b2f00e44f
Add test case.
6 years ago
Siegfried Pammer
cc19e9043e
Fix #603 : Single element arrays should not span multiple lines
...
Fix #1079 : CSharpFormattingOptions.AutoPropertyFormatting has no effect
6 years ago
Daniel Grunwald
03787bfc70
Avoid parentheses around lambdas where possible.
6 years ago
Siegfried Pammer
8e9ecf6c36
Fix #2162 : handle VariableInitializers like AssignmentExpressions in InsertParenthesesVisitor
6 years ago
Siegfried Pammer
04f9603768
Fix #2140 : ILSpy 6.2p1 no longer respects "use discards" setting
6 years ago
Siegfried Pammer
6824902663
Disable formatting of ExpressionTrees.cs, so appveyor does not complain.
6 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Chicken-Bones
22243de7b0
Improve ReduceNestingTransform by considering nested containers (Try/Using/Lock/Pinned/etc)
7 years ago
Daniel Grunwald
42f71b56f6
Fix #1811 : Assert in NullCoalescingInstruction.CheckInvariant after expression tree transform
7 years ago
Daniel Grunwald
b5eecb8afc
Don't remove redundant ToString() calls in expression trees.
7 years ago
Siegfried Pammer
fa7c1f574a
Do not convert simple LINQ method calls to LINQ expressions. Closes #1501 .
7 years ago
Siegfried Pammer
3d60c7bd70
Fix #1590 : Cast from override method to Delegate is not properly simplified
7 years ago
Siegfried Pammer
0e638dcb28
Fix #1524 : Adjust expression trees transform to work with async code as well.
7 years ago
Siegfried Pammer
8dc80583ec
#1485 : Fix decompilation of TypeAs with Nullable<T> in expression trees
8 years ago
Siegfried Pammer
0c1134f5ed
Fix #1356 : ExpressionTrees: ref parameter usage not transformed correctly.
8 years ago
Daniel Grunwald
0a9df3d373
Fix #1252 : Incorrect comparison type for lifted comparisons in expression trees.
8 years ago
Daniel Grunwald
35a0ee2263
Fix #1309 : Decompilation of dynamic casts.
8 years ago
Chicken-Bones
ab9397d099
Add ReduceNestingTransform
8 years ago
Siegfried Pammer
4fab913bf6
Fix #1249 : Bug in detection of multiple nested expression trees in query expressions.
8 years ago
Siegfried Pammer
4047c5c159
Add test case for #1224
8 years ago
Siegfried Pammer
4cca07aeb3
TransformExpressionTrees: Fix bug in Expression.Quote handling
8 years ago
Siegfried Pammer
6096b7df29
#907 : CallBuilder: If type arguments cannot be inferred from the parameter list, add them before asking overload resolution, but remove them again, if it does not reduce the number of casts.
8 years ago
Daniel Grunwald
d87820e226
Avoid redundant explicit boxing casts
8 years ago
Siegfried Pammer
5dd7eaf129
Fix #1093 : Remove usage of type or this qualifiers, when possible.
9 years ago
Daniel Grunwald
b3c176e39a
Prefer '#if CS60' over '#if !LEGACY_CSC'
9 years ago
Siegfried Pammer
a957163aa3
Fix unit tests
9 years ago
Daniel Grunwald
0b442e82bb
Ensure stack types for call arguments are correct.
9 years ago
Siegfried Pammer
2b669debdb
Extend expression tree tests
9 years ago
Siegfried Pammer
372e9e1a97
Fix handling of operators in Roslyn
9 years ago
Siegfried Pammer
352707d396
Update tests
9 years ago
Siegfried Pammer
9d0ff70f08
Fix some unnecessary casts, adjust test cases
9 years ago
Siegfried Pammer
e3606374a4
Refactor TransformExpressionTrees to use an (ILInstruction, IType) pair as result of every Convert call.
9 years ago
Siegfried Pammer
ad68204b04
Fix bugs in Expression.Quote/Expression.Invoke handling
...
Fix bugs in operator handling
9 years ago
Siegfried Pammer
049cff2324
Add unit tests, directly use ILFunction instead of NewObj(ILFunction) for expression trees.
9 years ago