CKTIS / C#
global: odniesienie praktyczne
global: odniesienie praktyczne: global:: wybiera korzeń przestrzeni nazw, omijając lokalny alias lub typ o tej samej nazwie.
Wersja: C# language; verified against C# 14 reference
Składnia
global /* grammar-specific form */global:: wybiera korzeń przestrzeni nazw, omijając lokalny alias lub typ o tej samej nazwie.
Stosuj w generatorach i kodzie z potencjalnymi konfliktami nazw.
Nie oznacza globalnego stanu ani widoczności publicznej.
global using ma inne znaczenie: import obowiązuje w całej kompilacji projektu.
Kompletny program rzeczywiście używa global; oczekiwany stdout to dokładnie global.
Przykłady
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");
Wynik
global
Kompletny program rzeczywiście używa `global`; oczekiwany stdout to dokładnie `global`.