Context
The parameter_modifiers.md spec documents out value: int inline declaration syntax at call sites, but it is not yet implemented.
Example:
from system import Int32
if Int32.try_parse("42", out value: int):
print(value)
Should emit:
if (Int32.TryParse("42", out int value))
{
Console.WriteLine(value);
}
What's needed
- Parser: extend
ModifiedArgument parsing to handle out identifier: type pattern
- Semantic: register the new variable in scope, validate type
- CodeGen: emit
out type identifier in C# argument position
Related
Context
The
parameter_modifiers.mdspec documentsout value: intinline declaration syntax at call sites, but it is not yet implemented.Example:
Should emit:
What's needed
ModifiedArgumentparsing to handleout identifier: typepatternout type identifierin C# argument positionRelated
parameter_modifiers.mdspec section "Inline Declaration with out"