You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a CakeMethodAlias method with a params System.Linq.Expressions.Expression<Func<string,string>> expressions parameter, the resulting Roslyn compilation fails.
Error: Roslyn.Compilers.CompilationErrorException: (1918,131): error CS0231: A params parameter must be the last parameter in a formal parameter list
at Roslyn.Scripting.CommonScriptEngine.CompilationError(DiagnosticBag localDiagnostics, DiagnosticBag diagnostics)
at Roslyn.Scripting.CommonScriptEngine.Compile(String code, String path, DiagnosticBag diagnostics, Session session, Type delegateType, Type returnType, CancellationToken cancellationToken, Boolean
isInteractive, Boolean isExecute, CommonCompilation& compilation, Delegate& factory)
at Roslyn.Scripting.CommonScriptEngine.Execute[T](String code, String path, DiagnosticBag diagnostics, Session session, Boolean isInteractive)
at Roslyn.Scripting.Session.Execute(String code)
at Cake.Scripting.Roslyn.Stable.DefaultRoslynScriptSession.Execute(Script script) in C:\git\cake\src\Cake\Scripting\Roslyn\Stable\DefaultRoslynScriptSession.cs:line 31
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments) in C:\git\cake\src\Cake.Core\Scripting\ScriptRunner.cs:line 189
at Cake.Commands.BuildCommand.Execute(CakeOptions options) in C:\git\cake\src\Cake\Commands\BuildCommand.cs:line 33
at Cake.CakeApplication.Run(CakeOptions options) in C:\git\cake\src\Cake\CakeApplication.cs:line 46
at Cake.Program.Main() in C:\git\cake\src\Cake\Program.cs:line 69
What is Expected?
I would expect the compilation to work as expected.
What version of Cake are you using?
0.14
Are you running on a 32 or 64 bit system?
x64
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)
Author a Cake add-in with the following method signature - actual implementation is obfuscated, it's the method signature that's causing the issue.
@kcamp thanks notifying us about this issue 👍 , for your PR please start Cake with -mono flag to so we see if mono has the same issue and it gets resolved there too.
What You Are Seeing?
When creating a CakeMethodAlias method with a
params System.Linq.Expressions.Expression<Func<string,string>> expressions
parameter, the resulting Roslyn compilation fails.What is Expected?
I would expect the compilation to work as expected.
What version of Cake are you using?
0.14
Are you running on a 32 or 64 bit system?
x64
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)
Author a Cake add-in with the following method signature - actual implementation is obfuscated, it's the method signature that's causing the issue.
Output Log
https://gist.github.com/kcamp/b08e1b5527baf2216a8005628652dbef
Further investigation shows that the underlying code being serialized for Roslyn in RoslynCodeGenerator.cs is malformed.
The text was updated successfully, but these errors were encountered: