CKTIS / C#
file: referencia práctica
file: referencia práctica: file limita un tipo de nivel superior al archivo fuente actual.
Versión: C# language; verified against C# 14 reference
Sintaxis
file /* grammar-specific form */file limita un tipo de nivel superior al archivo fuente actual.
Úsalo para tipos generados o auxiliares que no deban colisionar entre archivos.
Un tipo file no puede formar parte de un contrato public con mayor visibilidad.
Su nombre de metadatos se transforma; reflection no debe depender de él.
El programa completo usa realmente file; su stdout esperado exacto es 6.
Ejemplos
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;
Console.WriteLine(new LocalType().Value);
file sealed class LocalType { public int Value => 6; }
Resultado
6
El programa completo usa realmente `file`; su stdout esperado exacto es `6`.