question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Support for out parameters

See original GitHub issue

Hello, I need to call IDictionary.TryGetValue method in my expression, as I understand out parameters are not supported now. I’ve tried to execute following code in TryWindow application:

var dictionary = new Dictionary<string, object>();
dictionary.Add("x", 5);
object number = null;
if (dictionary.TryGetValue("x", out number))
	return number;
return 0;

and have got following message:

Variable [out] unknown in expression : [out number]

Mb I did something wrong? Are there any plans to support out parameters feature?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lofczcommented, Feb 24, 2021

Congratulations, great job @codingseb !

0reactions
codingsebcommented, Feb 24, 2021

I published version 1.4.20.0 that add support for out, ref, in keywords and for calling methods with params parameter.

The implementation is a bit more permissive than in pure C# and also required to modify a bit the way the library search the right override of a method and how it manage parameters to call it. I made a few tests to ensure that the most cases work but if you find some bugs related to this don’t hesitate to open new issues.

Thanks guys I am glad that this will allow a bunch of new stuff with EE.

Read more comments on GitHub >

github_iconTop Results From Across the Web

out parameter modifier - C# Reference
Declaring a method with out arguments is a classic workaround to return multiple values. Consider value tuples for similar scenarios. The ...
Read more >
out Parameter In C#
This article introduces new features of out parameter in C# 7.0. C# out parameter is used when a method returns multiple values.
Read more >
In-out parameters
In-out parameters act as persistent task variables. The parameter values are updated during task execution. The parameter might store a date value for...
Read more >
Out parameters
The purpose of an out parameter is to pass values back to the calling routine: the variable is passed by reference. The initial...
Read more >
How to write an async method with out parameter?
The only way to have supported out-by-reference parameters would be if the async feature were done by a low-level CLR rewrite instead of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found