GitNexus/gitnexus/test/fixtures/lang-resolution/csharp-null-check-narrowing/Services/App.cs
Gergo Magyar 06994e474a fix(type-resolution): address PR #387 review — dead code, nullable_type, scope boundaries + integration tests
- Remove dead replayPendingItems array and inert if-block in type-env.ts
- Add nullable_type fallback in extractKotlinDeclaration for val x: User? local vars
- Tighten isCSharpNullableDecl to avoid substring false positives on type names
- Add missing scope boundaries: function_expression (TS), constructor_declaration/
  local_function_statement/lambda_expression (C#) in null-check narrowing walkers
- Extend null-check narrowing fixtures and add 4 integration tests covering:
  Kotlin local variable nullable, C# constructor + lambda, TS function expression
2026-03-19 21:06:05 +00:00

44 lines
775 B
C#

using NullCheck.Models;
using System;
namespace NullCheck.Services
{
public class App
{
public App(User? x)
{
if (x != null)
{
x.Save();
}
}
public void ProcessInequality(User x)
{
if (x != null)
{
x.Save();
}
}
public void ProcessIsNotNull(User x)
{
if (x is not null)
{
x.Save();
}
}
public void ProcessInLambda(User? x)
{
Action act = () =>
{
if (x != null)
{
x.Save();
}
};
act();
}
}
}