CKTIS / C#
global: praktická reference
global: praktická reference: global:: vybere kořen namespace a obejde místní alias nebo stejně pojmenovaný typ.
Verze: C# language; verified against C# 14 reference
Syntaxe
global /* grammar-specific form */global:: vybere kořen namespace a obejde místní alias nebo stejně pojmenovaný typ.
Použijte v generátorech a kódu ohroženém konflikty názvů.
Neznamená globální stav ani viditelnost public.
global using má jiný význam: import platí pro celou kompilaci projektu.
Úplný program skutečně používá global; přesně očekávaný stdout je global.
Příklady
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;
global::System.Console.WriteLine("global");
Výsledek
global
Úplný program skutečně používá `global`; přesně očekávaný stdout je `global`.