Melonpi/android-jenkins-docker 0
Docker image with Jenkins that can build Android apps.
Melonpi/android-native-egl-example 0
Sample that shows how to combine native rendering with Java UI on Android
FFmpeg build for android random architectures with example jni
clone of git://git.blender.org/blender.git + my branches
mmd_tools is a blender addon for importing Models and Motions of MikuMikuDance.
Melonpi/build-opencv-for-android 0
An interactive script to download and build OpenCV and OpenCV contrib for Android
Melonpi/build-scripts-of-ffmpeg-x264-for-android-ndk 0
ffmpeg build scripts for android ndk usage (including x264)
test CI for C++
private cpp misc code.
PR opened opencv/opencv
closes #19647
It also fixes the build when universal intrinsics is disabled via -DDCV_ENABLE_INTRINSICS=OFF
.
pr created time in 2 minutes
Pull request review commentdotnet/csharplang
Clarify scoping and name lookup rules around Global Using directives.
Syntax for a using directive is extended with an optional `global` keyword that can precede the `using` keyword: ```antlr-using_directive- : 'global'? 'using' ('static' | name_equals)? name ';'- ;+compilation_unit+ : extern_alias_directive* global_using_directive* using_directive* global_attributes? namespace_member_declaration*+ ;++global_using_directive+ : global_using_alias_directive+ | global_using_namespace_directive+ | global_using_static_directive+ ;++global_using_alias_directive+ : 'global' 'using' identifier '=' namespace_or_type_name ';'+ ;++global_using_namespace_directive+ : 'global' 'using' namespace_name ';'+ ;+ +global_using_static_directive+ : 'global' 'using' 'static' type_name ';'+ ; ``` -- Global Using Directives are allowed only on the Compilation Unit level (cannot be used inside a namespace declaration).-- Global Using directives, if any, must precede any non-global using directives. -- The scope of a Global Using Directive extends over the namespace member declarations and non-global using directives of all compilation units within the program.-The scope of a Global Using Directive specifically does not include other Global Using Directives. Thus, peer Global Using Directives or those from a different+- The *global_using_directive*s are allowed only on the Compilation Unit level (cannot be used inside a *namespace_declaration*).+- The *global_using_directive*s, if any, must precede any *using_directive*s. +- The scope of a *global_using_directive*s extends over the namespace member declarations and *using_directive*s of all compilation units within the program.+The scope of a *global_using_directive* specifically does not include other *global_using_directive*s. Thus, peer *global_using_directive*s or those from a different compilation unit do not affect each other, and the order in which they are written is insignificant.++# Scopes +https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#scopes++These are the relevant bullet points with proposed additions (which are **in bold**):+* The scope of name defined by an *extern_alias_directive* extends over the ***global_using_directive*s,** *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing compilation unit or namespace body. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the compilation unit or namespace body in which it occurs.
I think the statement with other added sections clearly describes how this works. "Other::A" should resolve to a namespace in context of the compilation unit where the using is "declared". Other compilation units never look at global aliases of each other. There is no need to do that.
In reply to: 589679320 [](ancestors = 589679320,589654069,589650067,589647367,589635783)
comment created time in 5 minutes
Pull request review commentdotnet/csharplang
Clarify scoping and name lookup rules around Global Using directives.
Syntax for a using directive is extended with an optional `global` keyword that can precede the `using` keyword: ```antlr-using_directive- : 'global'? 'using' ('static' | name_equals)? name ';'- ;+compilation_unit+ : extern_alias_directive* global_using_directive* using_directive* global_attributes? namespace_member_declaration*+ ;++global_using_directive+ : global_using_alias_directive+ | global_using_namespace_directive+ | global_using_static_directive+ ;++global_using_alias_directive+ : 'global' 'using' identifier '=' namespace_or_type_name ';'+ ;++global_using_namespace_directive+ : 'global' 'using' namespace_name ';'+ ;+ +global_using_static_directive+ : 'global' 'using' 'static' type_name ';'+ ; ``` -- Global Using Directives are allowed only on the Compilation Unit level (cannot be used inside a namespace declaration).-- Global Using directives, if any, must precede any non-global using directives. -- The scope of a Global Using Directive extends over the namespace member declarations and non-global using directives of all compilation units within the program.-The scope of a Global Using Directive specifically does not include other Global Using Directives. Thus, peer Global Using Directives or those from a different+- The *global_using_directive*s are allowed only on the Compilation Unit level (cannot be used inside a *namespace_declaration*).+- The *global_using_directive*s, if any, must precede any *using_directive*s. +- The scope of a *global_using_directive*s extends over the namespace member declarations and *using_directive*s of all compilation units within the program.+The scope of a *global_using_directive* specifically does not include other *global_using_directive*s. Thus, peer *global_using_directive*s or those from a different compilation unit do not affect each other, and the order in which they are written is insignificant.++# Scopes +https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#scopes++These are the relevant bullet points with proposed additions (which are **in bold**):+* The scope of name defined by an *extern_alias_directive* extends over the ***global_using_directive*s,** *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing compilation unit or namespace body. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the compilation unit or namespace body in which it occurs.
Because they do apply. Exactly as specified in that statement.
Then I'm back to my original question :). How does this work:
extern alias Other;
global using Other::A;
When a different compilation unit is looking at this global using alias, does it have to resolve the extern alias? If not, how does that global using work? And if so, then I'd rather have us introduce a global extern alias.
I don't necessarily expect you to answer this in this PR, but it would be good to have an open question about how extern aliases apply to global using directives.
In reply to: 589654069 [](ancestors = 589654069,589650067,589647367,589635783)
comment created time in 13 minutes
Pull request review commentmicrosoft/DirectXShaderCompiler
Infer wave-sensitivity of cyclic dependencies
class WaveSensitivityAnalyzer : public WaveSensitivityAnalysis { public: WaveSensitivityAnalyzer(PostDominatorTree &PDT) : pPDT(&PDT) {} void Analyze(Function *F);+ void Analyze(); bool IsWaveSensitive(Instruction *op); }; WaveSensitivityAnalysis* WaveSensitivityAnalysis::create(PostDominatorTree &PDT) { return new WaveSensitivityAnalyzer(PDT); } +// Analyze the given function's instructions as wave-sensitive or not void WaveSensitivityAnalyzer::Analyze(Function *F) {- UpdateBlock(&F->getEntryBlock(), KnownNotSensitive);+ // Add all blocks but the entry in reverse order so they come out in order+ auto it = F->getBasicBlockList().end();+ for ( it-- ; it != F->getBasicBlockList().begin(); it--)+ BBWorkList.emplace_back(&*it);+ // Add entry block as non-sensitive+ UpdateBlock(&*it, KnownNotSensitive);++ // First analysis+ Analyze();++ // If any phis with explored preds remain unknown+ // it has to be in a loop that don't include wave sensitivity+ // Update each as such and redo Analyze to mark the descendents+ while (!UnknownPhis.empty() || !InstWorkList.empty() || !BBWorkList.empty()) {+ while (!UnknownPhis.empty()) {+ PHINode *Phi = UnknownPhis.back();+ UnknownPhis.pop_back();+ // UnknownPhis might have actually known phis that were changed. skip them+ if (Unknown == GetInstState(Phi)) {+ // If any of the preds have not been visited, we can't assume a cycle yet+ bool allPredsVisited = true;+ for (unsigned i = 0; i < Phi->getNumIncomingValues(); i++) {+ if (!BBState.count(Phi->getIncomingBlock(i))) {+ allPredsVisited = false;+ break;+ }+ }+ if (allPredsVisited)+ UpdateInst(Phi, KnownNotSensitive);
What if all incoming values are KnowSensitive?
comment created time in 14 minutes
issue openeddotnet/roslyn-analyzers
CA1416 emits warnings for internal code
Analyzer
Diagnostic ID: CA1416
Analyzer source
SDK: Built-in CA analyzers in .NET 5 SDK or later
Version: SDK 5.0.200
[SupportedOSPlatform("windows10.0.17763.0")]
internal class Stuff
{
// logic that calls into WinRT
}
Expected: no warning since code is internal. Actual: warning
Note: We (MSAL.NET) does not maintain public internal surface and change it frequently.
created time in 15 minutes
issue commentmicrosoft/vscode-cpptools
StringView in natvis seems to be ignored
Thank you for reporting this issue. We’ll let you know if we need more information to investigate it.
comment created time in 17 minutes
issue commentgoogle/ExoPlayer
I have checked ExoPlayer download service, but I didn't used it. Our app needs to be able to let users have access to the files outside app. ExoPlayer download service is for playback only if I am not mistaking. If I was using the download service, I guess I should use two cache instances as you said, each on a different directory, one being for streaming with LRU, and the other one for user downloads with no eviction. Using the download service, still I can't find a way to make sure files are fetched from network only once.
For my snippet, I shouldn't use FLAG_BLOCK_ON_CACHE because that may cause download to block playback, which is terrible. Without this flag however, if download is started first, it will fill the cache and playback won't use cache at all, and if download is started while streaming, download won't use cache. So network usage isn't efficient unless download and streaming happen one after another without overlap.
comment created time in 17 minutes
issue commentmicrosoft/vscode-cpptools
No "VARIABLES" when debugging GTests with Test Explorer
Which debugger are you using cppdbg
or cppvsdbg
and if possible can you provide logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true }
in your launch.json
comment created time in 18 minutes
push eventkeras-team/keras
commit sha ed8a6d6c6dae728874226aa9edd944049eabfffd
Sync OSS keras to head PiperOrigin-RevId: 361607345
push time in 19 minutes
Pull request review commentdotnet/csharplang
Clarify scoping and name lookup rules around Global Using directives.
Syntax for a using directive is extended with an optional `global` keyword that can precede the `using` keyword: ```antlr-using_directive- : 'global'? 'using' ('static' | name_equals)? name ';'- ;+compilation_unit+ : extern_alias_directive* global_using_directive* using_directive* global_attributes? namespace_member_declaration*+ ;++global_using_directive+ : global_using_alias_directive+ | global_using_namespace_directive+ | global_using_static_directive+ ;++global_using_alias_directive+ : 'global' 'using' identifier '=' namespace_or_type_name ';'+ ;++global_using_namespace_directive+ : 'global' 'using' namespace_name ';'+ ;+ +global_using_static_directive+ : 'global' 'using' 'static' type_name ';'+ ; ``` -- Global Using Directives are allowed only on the Compilation Unit level (cannot be used inside a namespace declaration).-- Global Using directives, if any, must precede any non-global using directives. -- The scope of a Global Using Directive extends over the namespace member declarations and non-global using directives of all compilation units within the program.-The scope of a Global Using Directive specifically does not include other Global Using Directives. Thus, peer Global Using Directives or those from a different+- The *global_using_directive*s are allowed only on the Compilation Unit level (cannot be used inside a *namespace_declaration*).+- The *global_using_directive*s, if any, must precede any *using_directive*s. +- The scope of a *global_using_directive*s extends over the namespace member declarations and *using_directive*s of all compilation units within the program.+The scope of a *global_using_directive* specifically does not include other *global_using_directive*s. Thus, peer *global_using_directive*s or those from a different compilation unit do not affect each other, and the order in which they are written is insignificant.++# Scopes +https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#scopes++These are the relevant bullet points with proposed additions (which are **in bold**):+* The scope of name defined by an *extern_alias_directive* extends over the ***global_using_directive*s,** *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing compilation unit or namespace body. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the compilation unit or namespace body in which it occurs.+* **The scope of a name defined or imported by a *global_using_directive* extends over the *using_directive*s, *global_attributes* and *namespace_member_declaration*s of all the *compilation_unit*s in the program.**++# Namespace and type names+https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#namespace-and-type-names++Changes are made to the algorithm determining the meaning of a *namespace_or_type_name* as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* If the *namespace_or_type_name* is of the form `I` or of the form `I<A1, ..., Ak>`:+ * If `K` is zero and the *namespace_or_type_name* appears within a generic method declaration ([Methods](classes.md#methods)) and if that declaration includes a type parameter ([Type parameters](classes.md#type-parameters)) with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within a type declaration, then for each instance type `T` ([The instance type](classes.md#the-instance-type)), starting with the instance type of that type declaration and continuing with the instance type of each enclosing class or struct declaration (if any):+ * If `K` is zero and the declaration of `T` includes a type parameter with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within the body of the type declaration, and `T` or any of its base types contain a nested accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments. If there is more than one such type, the type declared within the more derived type is selected. Note that non-type members (constants, fields, methods, properties, indexers, operators, instance constructors, destructors, and static constructors) and type members with a different number of type parameters are ignored when determining the meaning of the *namespace_or_type_name*.+ * If the previous steps were unsuccessful then, for each namespace `N`, starting with the namespace in which the *namespace_or_type_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the namespace named `I` in `N`.+ * Otherwise, if `N` contains an accessible type having name `I` and `K` type parameters, then:+ * If `K` is zero and the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the type constructed with the given type arguments.+ * Otherwise, if the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N`:+ * If `K` is zero and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with an imported namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with an imported namespace or type,** then the *namespace_or_type_name* refers to that namespace or type.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain more than one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.+ * **Otherwise, if the namespaces and type declarations imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.**
We will discuss this at LDM and make the decision.
Please consider adding a note that it's an open question then.
In reply to: 589656318 [](ancestors = 589656318,589639148)
comment created time in 21 minutes
issue closedboostorg/boost
No regression testing against NVCC compiler
We have an application involving realtime processing that uses boost and CUDA. CUDA is a great way to leverage the computing power of GPUs for numerical calculations. I have found that boost and CUDA do not play well together resulting in warnings and sometimes in build issues. I now realize that this is likely because there is not regression testing on the NVCC compilers from nvidia. Is there any interest in running these tests or is ours a completely unique use case?
closed time in 27 minutes
dahubleyissue commentboostorg/boost
No regression testing against NVCC compiler
All of our testing is done on a volunteer basis. I'm sure the library authors would welcome someone running an NVCC testing instance. Docs are here: https://www.boost.org/development/running_regression_tests.html
comment created time in 27 minutes
issue commentassimp/assimp
thread-local storage is not supported for the current target
@RichardTea I issued a pull request to fix this issue. Would you mind taking a look and let me know if you can pull that into master?
comment created time in 27 minutes
issue commentKhronosGroup/glslang
64-bit Int OpAtomicStore doesn't generate Int64Atomics Capability
It almost worked. Just a problem with atomicCounterMin/Max for uint where the frontend is playing a little loose and using sint in some places. I am going to try to straighten that out as well :(
comment created time in 29 minutes
issue commentboostorg/boost
A much better place to ask this is on the boost-users mailing list: boost-users@lists.boost.org. Many more people will see it there.
comment created time in 30 minutes
issue openedmicrosoft/vscode-cpptools
Intellisense Not Working On Remote SSH
Issue Type: <b>Bug</b>
I recently connected to my school's computer using the Remote - SSH extension. I have installed the C/C++ extension on my school computer as well. However, Intellisense is not working. These are the steps I followed to get to where I am now:
- Download the Remote - SSH extension.
- Open the Command Palette and search and click on "Remote-SSH: Add New SSH Host".
- Enter the SSH connection command, i.e. * ssh hello@microsoft.com *.
- Select SSH configuration file to update (two options appeared for me: ~/.ssh/config and /etc/ssh/ssh_config. I selected the first one).
- Connect to the host by clicking on the "Connect" button on the dialog that appears in the bottom right.
- Download the C/C++ extension on my school computer.
VS Code is able to successfully connect to the host since the built-in terminal shows the home directory of my school's PC. Additionally, the configuration now running is Linux as shown in the bottom right. However, I am having the following issues with Intellisense:
- No auto suggestion boxes appear while I type.
- None of the Intellisense features work.
- When I save a file, a dialog box appears that says "Saving 'my_project.cpp': Running 'C/C++' Formatter (configure)" and never disappears.
All of these features work on my local computer.
Extension version: 1.2.2 VS Code version: Code 1.54.1 (f30a9b73e8ffc278e71575118b6bf568f04587c8, 2021-03-04T22:42:18.719Z) OS version: Darwin x64 20.3.0 Remote OS version: Linux x64 4.15.0-136-generic
<details> <summary>System Info</summary>
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz (8 x 2300) |
GPU Status | 2d_canvas: enabled<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: enabled<br>opengl: enabled_on<br>protected_video_decode: unavailable_off<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>webgl: enabled<br>webgl2: enabled |
Load (avg) | 2, 2, 2 |
Memory (System) | 8.00GB (0.12GB free) |
Process Argv | --crash-reporter-id 6eda11e3-d929-4a56-81ad-83e0d39be8d1 |
Screen Reader | no |
VM | 0% |
Item | Value |
---|---|
Remote | SSH: pc28.cs.ucdavis.edu |
OS | Linux x64 4.15.0-136-generic |
CPUs | Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 x 2500) |
Memory (System) | 15.61GB (13.97GB free) |
VM | 0% |
</details><details> <summary>A/B Experiments</summary>
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry914:30256638
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
dockersubset:30265998
pythontbcf:30265426
vspre833cf:30267465
</details>
<!-- generated by issue reporter -->
created time in 31 minutes
issue openeddotnet/roslyn-analyzers
How to fix CA1416 for net5-windows10.0.17763.0 ?
Analyzer
Diagnostic ID: CA1416
Analyzer source
SDK: Built-in CA analyzers in .NET 5 SDK or later
Version: 5.0.200-preview.21077.7
Describe the bug
In my library I have
public class MSAL
{
[SupportedOSPlatform("windows10.0.17763.0")]
public static void UseWAM()
{
WebTokenRequest webTokenRequest = new WebTokenRequest(null);
}
}
A calling app does :
class Program
{
static void Main(string[] args)
{
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17763, 0))
{
MSAL.UseWAM(); // gets a warning despite the platform guard
}
}
}
Expected behavior
no CA1416 warning in app
Actual behavior
warning
Additional context
If I change it to [SupportedOSPlatform("windows")] and OperatingSystem.IsWindows, the warning goes away.
created time in 33 minutes
issue openedboostorg/boost
hi,
i was just digging in recent updates history of my Win 10 20H2 update. and found this repo following the trail (in reverse order):
https://github.com/boostorg/boost
<-- https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RE2Jy2l
<-- https://www.microsoft.com/en-us/wdsi/defenderupdates or https://go.microsoft.com/fwlink/?linkid=2007160
<--
so, i was thinking what role does this play there?
created time in 33 minutes
pull request commentgoogle/ExoPlayer
Support tts:textEmphasis in TTML parser and WebView output
Ah, well spotted! I had the same problem with rubies because I didn't realise background-color
doesn't inherit automatically, unlike most other CSS properties (did I mention I'm not a web developer?).
I fixed that by 'forcing' the inheritance using CSS: https://github.com/google/ExoPlayer/commit/cdfee89181b4d52a99c4375bac7b26f76b51da98
But that doesn't help here because there's no DOM element representing the emphasis marks apart from the span around the text.
So is it a rendering bug? It's clear the line height changes when adding a text-emphasis
style property to a span (as in, the lines end up further apart) but when selecting the element in the chrome inspector only the 'base text' seems to be considered part of the span element. So what element are you supposed to use to cover the background of the emphasis marks?
Maybe we need to revisit the way I fixed the ruby problem and instead of forcing inheritance using CSS, we could try and draw a bounding box and set the background on that. Not immediately sure how to do that without JS, which I was hoping to avoid at all costs...
comment created time in 39 minutes
issue commentsyl20bnr/spacemacs
Globally turn off smartparens paren matching (2018 edition)
Update: it is indeed smartparens.
Workaround: add
(add-hook 'python-mode-hook 'spacemacs/toggle-smartparens-off)
to my dotspacemacs/user-config
.
comment created time in 41 minutes
push eventdotnet/csharplang
commit sha 8a5955168e85fec63b404189cbbe8ca79c4fb34c
Add initial required properties proposal (#4493)
push time in 44 minutes
PR merged dotnet/csharplang
This is the initial required properties proposal discussed today, modulo some clarifications and adding more open questions. I'd like to get this checked in, then we can start working through open questions in future LDMs.
pr closed time in 44 minutes
Pull request review commentdotnet/csharplang
Clarify scoping and name lookup rules around Global Using directives.
Syntax for a using directive is extended with an optional `global` keyword that can precede the `using` keyword: ```antlr-using_directive- : 'global'? 'using' ('static' | name_equals)? name ';'- ;+compilation_unit+ : extern_alias_directive* global_using_directive* using_directive* global_attributes? namespace_member_declaration*+ ;++global_using_directive+ : global_using_alias_directive+ | global_using_namespace_directive+ | global_using_static_directive+ ;++global_using_alias_directive+ : 'global' 'using' identifier '=' namespace_or_type_name ';'+ ;++global_using_namespace_directive+ : 'global' 'using' namespace_name ';'+ ;+ +global_using_static_directive+ : 'global' 'using' 'static' type_name ';'+ ; ``` -- Global Using Directives are allowed only on the Compilation Unit level (cannot be used inside a namespace declaration).-- Global Using directives, if any, must precede any non-global using directives. -- The scope of a Global Using Directive extends over the namespace member declarations and non-global using directives of all compilation units within the program.-The scope of a Global Using Directive specifically does not include other Global Using Directives. Thus, peer Global Using Directives or those from a different+- The *global_using_directive*s are allowed only on the Compilation Unit level (cannot be used inside a *namespace_declaration*).+- The *global_using_directive*s, if any, must precede any *using_directive*s. +- The scope of a *global_using_directive*s extends over the namespace member declarations and *using_directive*s of all compilation units within the program.+The scope of a *global_using_directive* specifically does not include other *global_using_directive*s. Thus, peer *global_using_directive*s or those from a different compilation unit do not affect each other, and the order in which they are written is insignificant.++# Scopes +https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#scopes++These are the relevant bullet points with proposed additions (which are **in bold**):+* The scope of name defined by an *extern_alias_directive* extends over the ***global_using_directive*s,** *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing compilation unit or namespace body. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the compilation unit or namespace body in which it occurs.+* **The scope of a name defined or imported by a *global_using_directive* extends over the *using_directive*s, *global_attributes* and *namespace_member_declaration*s of all the *compilation_unit*s in the program.**++# Namespace and type names+https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#namespace-and-type-names++Changes are made to the algorithm determining the meaning of a *namespace_or_type_name* as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* If the *namespace_or_type_name* is of the form `I` or of the form `I<A1, ..., Ak>`:+ * If `K` is zero and the *namespace_or_type_name* appears within a generic method declaration ([Methods](classes.md#methods)) and if that declaration includes a type parameter ([Type parameters](classes.md#type-parameters)) with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within a type declaration, then for each instance type `T` ([The instance type](classes.md#the-instance-type)), starting with the instance type of that type declaration and continuing with the instance type of each enclosing class or struct declaration (if any):+ * If `K` is zero and the declaration of `T` includes a type parameter with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within the body of the type declaration, and `T` or any of its base types contain a nested accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments. If there is more than one such type, the type declared within the more derived type is selected. Note that non-type members (constants, fields, methods, properties, indexers, operators, instance constructors, destructors, and static constructors) and type members with a different number of type parameters are ignored when determining the meaning of the *namespace_or_type_name*.+ * If the previous steps were unsuccessful then, for each namespace `N`, starting with the namespace in which the *namespace_or_type_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the namespace named `I` in `N`.+ * Otherwise, if `N` contains an accessible type having name `I` and `K` type parameters, then:+ * If `K` is zero and the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the type constructed with the given type arguments.+ * Otherwise, if the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N`:+ * If `K` is zero and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with an imported namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with an imported namespace or type,** then the *namespace_or_type_name* refers to that namespace or type.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain more than one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.+ * **Otherwise, if the namespaces and type declarations imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.**+ * **Otherwise, if the namespaces and types imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain more than one accessible typehaving name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.**+ * Otherwise, the *namespace_or_type_name* is undefined and a compile-time error occurs.++# Simple names+https://github.com/dotnet/csharplang/blob/master/spec/expressions.md#simple-names++Changes are made to the *simple_name* evaluation rules as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* Otherwise, for each namespace `N`, starting with the namespace in which the *simple_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *simple_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *simple_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *simple_name* refers to the namespace named `I` in `N`.+ * Otherwise, if `N` contains an accessible type having name `I` and `K` type parameters, then:+ * If `K` is zero and the location where the *simple_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *simple_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the type constructed with the given type arguments.+ * Otherwise, if the location where the *simple_name* occurs is enclosed by a namespace declaration for `N`:+ * If `K` is zero and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with an imported namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with an imported namespace or type,** then the *simple_name* refers to that namespace or type.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_static_directive*s of the namespace declaration contain exactly one accessible type or non-extension static member having name `I` and `K` type parameters, then the *simple_name* refers to that type or member constructed with the given type arguments.+ * Otherwise, if the namespaces and types imported by the *using_namespace_directive*s of the namespace declaration contain more than one accessible type or non-extension-method static member having name `I` and `K` type parameters, then the *simple_name* is ambiguous and an error occurs.+ * **Otherwise, if the namespaces and type declarations imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain exactly one accessible type or non-extension static member having name `I` and `K` type parameters, then the *simple_name* refers to that type or member constructed with the given type arguments.**
comment created time in an hour
Pull request review commentKhronosGroup/glTF
+# KHR_lights_dome++## Contributors++* Ben Houston, Threekit, <https://twitter.com/BenHouston3D>+* Romain Guy, Google, <https://twitter.com/romainguy>++## Status++Proposed.++## Dependencies++Written against the glTF 2.0 spec.++## Overview++This extension provides the ability to define a single image-based dome light in a glTF scene. A dome light illuminate the scene as if the light was coming from a sphere outside of the scene extents. Only one dome light per scene is supported to avoid confusing this dome light extension with being a specular or diffuse light probe solution.++Many 3D tools and engines support image-based global illumination but the exact technique and data formats employed vary.++### Differences from EXT_lights_image_based++This extension is similar to the EXT_lights_image_based extension but differs in a bunch of important ways. These differences are motivated by trying to not presuppose the implementation of the rendering method, rather than letting that leak into the data transfer format specification. It also simplifies what is stored to the minimum, any additional data can be derived as necessary by the rendering engine.++The differences are:++- The cube map is stored in non-prefiltered form (in nits units), rather than prefiltered (in lux units.)+- Only the top level full resolution cube map is stored, rather than the mip chain.+- The cube map data, if specified via a PNG, is assumed to be encoded in R11G11B10F, rather than RGBD.
To further reduce transmission size, BC6H data could be RDO-encoded (TBD) and losslessly compressed with Zstandard (already included in KTX v2, currently used only with UASTC codec as a part of KHR_texture_basisu
).
Another work is in progress to improve mobile support.
comment created time in an hour
Pull request review commentdotnet/csharplang
Clarify scoping and name lookup rules around Global Using directives.
Syntax for a using directive is extended with an optional `global` keyword that can precede the `using` keyword: ```antlr-using_directive- : 'global'? 'using' ('static' | name_equals)? name ';'- ;+compilation_unit+ : extern_alias_directive* global_using_directive* using_directive* global_attributes? namespace_member_declaration*+ ;++global_using_directive+ : global_using_alias_directive+ | global_using_namespace_directive+ | global_using_static_directive+ ;++global_using_alias_directive+ : 'global' 'using' identifier '=' namespace_or_type_name ';'+ ;++global_using_namespace_directive+ : 'global' 'using' namespace_name ';'+ ;+ +global_using_static_directive+ : 'global' 'using' 'static' type_name ';'+ ; ``` -- Global Using Directives are allowed only on the Compilation Unit level (cannot be used inside a namespace declaration).-- Global Using directives, if any, must precede any non-global using directives. -- The scope of a Global Using Directive extends over the namespace member declarations and non-global using directives of all compilation units within the program.-The scope of a Global Using Directive specifically does not include other Global Using Directives. Thus, peer Global Using Directives or those from a different+- The *global_using_directive*s are allowed only on the Compilation Unit level (cannot be used inside a *namespace_declaration*).+- The *global_using_directive*s, if any, must precede any *using_directive*s. +- The scope of a *global_using_directive*s extends over the namespace member declarations and *using_directive*s of all compilation units within the program.+The scope of a *global_using_directive* specifically does not include other *global_using_directive*s. Thus, peer *global_using_directive*s or those from a different compilation unit do not affect each other, and the order in which they are written is insignificant.++# Scopes +https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#scopes++These are the relevant bullet points with proposed additions (which are **in bold**):+* The scope of name defined by an *extern_alias_directive* extends over the ***global_using_directive*s,** *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing compilation unit or namespace body. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the compilation unit or namespace body in which it occurs.+* **The scope of a name defined or imported by a *global_using_directive* extends over the *using_directive*s, *global_attributes* and *namespace_member_declaration*s of all the *compilation_unit*s in the program.**++# Namespace and type names+https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#namespace-and-type-names++Changes are made to the algorithm determining the meaning of a *namespace_or_type_name* as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* If the *namespace_or_type_name* is of the form `I` or of the form `I<A1, ..., Ak>`:+ * If `K` is zero and the *namespace_or_type_name* appears within a generic method declaration ([Methods](classes.md#methods)) and if that declaration includes a type parameter ([Type parameters](classes.md#type-parameters)) with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within a type declaration, then for each instance type `T` ([The instance type](classes.md#the-instance-type)), starting with the instance type of that type declaration and continuing with the instance type of each enclosing class or struct declaration (if any):+ * If `K` is zero and the declaration of `T` includes a type parameter with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within the body of the type declaration, and `T` or any of its base types contain a nested accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments. If there is more than one such type, the type declared within the more derived type is selected. Note that non-type members (constants, fields, methods, properties, indexers, operators, instance constructors, destructors, and static constructors) and type members with a different number of type parameters are ignored when determining the meaning of the *namespace_or_type_name*.+ * If the previous steps were unsuccessful then, for each namespace `N`, starting with the namespace in which the *namespace_or_type_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the namespace named `I` in `N`.+ * Otherwise, if `N` contains an accessible type having name `I` and `K` type parameters, then:+ * If `K` is zero and the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the type constructed with the given type arguments.+ * Otherwise, if the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N`:+ * If `K` is zero and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with an imported namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with an imported namespace or type,** then the *namespace_or_type_name* refers to that namespace or type.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain more than one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.+ * **Otherwise, if the namespaces and type declarations imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.**+ * **Otherwise, if the namespaces and types imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain more than one accessible typehaving name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.**+ * Otherwise, the *namespace_or_type_name* is undefined and a compile-time error occurs.++# Simple names+https://github.com/dotnet/csharplang/blob/master/spec/expressions.md#simple-names++Changes are made to the *simple_name* evaluation rules as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* Otherwise, for each namespace `N`, starting with the namespace in which the *simple_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *simple_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *simple_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *simple_name* refers to the namespace named `I` in `N`.+ * Otherwise, if `N` contains an accessible type having name `I` and `K` type parameters, then:+ * If `K` is zero and the location where the *simple_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *simple_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the type constructed with the given type arguments.+ * Otherwise, if the location where the *simple_name* occurs is enclosed by a namespace declaration for `N`:+ * If `K` is zero and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with an imported namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with an imported namespace or type,** then the *simple_name* refers to that namespace or type.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_static_directive*s of the namespace declaration contain exactly one accessible type or non-extension static member having name `I` and `K` type parameters, then the *simple_name* refers to that type or member constructed with the given type arguments.+ * Otherwise, if the namespaces and types imported by the *using_namespace_directive*s of the namespace declaration contain more than one accessible type or non-extension-method static member having name `I` and `K` type parameters, then the *simple_name* is ambiguous and an error occurs.+ * **Otherwise, if the namespaces and type declarations imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain exactly one accessible type or non-extension static member having name `I` and `K` type parameters, then the *simple_name* refers to that type or member constructed with the given type arguments.**+ * **Otherwise, if the namespaces and types imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain more than one accessible type or non-extension-method static member having name `I` and `K` type parameters, then the *simple_name* is ambiguous and an error occurs.**++# Extension method invocations+https://github.com/dotnet/csharplang/blob/master/spec/expressions.md#extension-method-invocations++Changes are made to the algorithm to find the best *type_name* `C` as follows.+This is the relevant bullet point with proposed additions (which are **in bold**):+* Starting with the closest enclosing namespace declaration, continuing with each enclosing namespace declaration, and ending with the containing compilation unit, successive attempts are made to find a candidate set of extension methods:+ * If the given namespace or compilation unit directly contains non-generic type declarations `Ci` with eligible extension methods `Mj`, then the set of those extension methods is the candidate set.+ * If types `Ci` imported by *using_static_declarations* and directly declared in namespaces imported by *using_namespace_directive*s in the given namespace or compilation unit directly contain eligible extension methods `Mj`, then the set of those extension methods is the candidate set.+ * **If containing compilation unit is reached and if types `Ci` imported by *global_using_static_declarations* and directly declared in namespaces imported by *global_using_namespace_directive*s in the program directly contain eligible extension methods `Mj`, then the set of those extension methods is the candidate set.**
comment created time in an hour
Pull request review commentdotnet/csharplang
Clarify scoping and name lookup rules around Global Using directives.
Syntax for a using directive is extended with an optional `global` keyword that can precede the `using` keyword: ```antlr-using_directive- : 'global'? 'using' ('static' | name_equals)? name ';'- ;+compilation_unit+ : extern_alias_directive* global_using_directive* using_directive* global_attributes? namespace_member_declaration*+ ;++global_using_directive+ : global_using_alias_directive+ | global_using_namespace_directive+ | global_using_static_directive+ ;++global_using_alias_directive+ : 'global' 'using' identifier '=' namespace_or_type_name ';'+ ;++global_using_namespace_directive+ : 'global' 'using' namespace_name ';'+ ;+ +global_using_static_directive+ : 'global' 'using' 'static' type_name ';'+ ; ``` -- Global Using Directives are allowed only on the Compilation Unit level (cannot be used inside a namespace declaration).-- Global Using directives, if any, must precede any non-global using directives. -- The scope of a Global Using Directive extends over the namespace member declarations and non-global using directives of all compilation units within the program.-The scope of a Global Using Directive specifically does not include other Global Using Directives. Thus, peer Global Using Directives or those from a different+- The *global_using_directive*s are allowed only on the Compilation Unit level (cannot be used inside a *namespace_declaration*).+- The *global_using_directive*s, if any, must precede any *using_directive*s. +- The scope of a *global_using_directive*s extends over the namespace member declarations and *using_directive*s of all compilation units within the program.+The scope of a *global_using_directive* specifically does not include other *global_using_directive*s. Thus, peer *global_using_directive*s or those from a different compilation unit do not affect each other, and the order in which they are written is insignificant.++# Scopes +https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#scopes++These are the relevant bullet points with proposed additions (which are **in bold**):+* The scope of name defined by an *extern_alias_directive* extends over the ***global_using_directive*s,** *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing compilation unit or namespace body. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the compilation unit or namespace body in which it occurs.+* **The scope of a name defined or imported by a *global_using_directive* extends over the *using_directive*s, *global_attributes* and *namespace_member_declaration*s of all the *compilation_unit*s in the program.**++# Namespace and type names+https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#namespace-and-type-names++Changes are made to the algorithm determining the meaning of a *namespace_or_type_name* as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* If the *namespace_or_type_name* is of the form `I` or of the form `I<A1, ..., Ak>`:+ * If `K` is zero and the *namespace_or_type_name* appears within a generic method declaration ([Methods](classes.md#methods)) and if that declaration includes a type parameter ([Type parameters](classes.md#type-parameters)) with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within a type declaration, then for each instance type `T` ([The instance type](classes.md#the-instance-type)), starting with the instance type of that type declaration and continuing with the instance type of each enclosing class or struct declaration (if any):+ * If `K` is zero and the declaration of `T` includes a type parameter with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within the body of the type declaration, and `T` or any of its base types contain a nested accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments. If there is more than one such type, the type declared within the more derived type is selected. Note that non-type members (constants, fields, methods, properties, indexers, operators, instance constructors, destructors, and static constructors) and type members with a different number of type parameters are ignored when determining the meaning of the *namespace_or_type_name*.+ * If the previous steps were unsuccessful then, for each namespace `N`, starting with the namespace in which the *namespace_or_type_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the namespace named `I` in `N`.+ * Otherwise, if `N` contains an accessible type having name `I` and `K` type parameters, then:+ * If `K` is zero and the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the type constructed with the given type arguments.+ * Otherwise, if the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N`:+ * If `K` is zero and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with an imported namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with an imported namespace or type,** then the *namespace_or_type_name* refers to that namespace or type.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain more than one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.+ * **Otherwise, if the namespaces and type declarations imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.**+ * **Otherwise, if the namespaces and types imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain more than one accessible typehaving name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.**+ * Otherwise, the *namespace_or_type_name* is undefined and a compile-time error occurs.++# Simple names+https://github.com/dotnet/csharplang/blob/master/spec/expressions.md#simple-names++Changes are made to the *simple_name* evaluation rules as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* Otherwise, for each namespace `N`, starting with the namespace in which the *simple_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *simple_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *simple_name* is ambiguous and a compile-time error occurs.
comment created time in an hour
pull request commentdotnet/csharplang
Add improved interpolated strings spec
It would just work :)
I misunderstood the suggestion. I thought it was asking for the whole string to be passed in (e.g.
"{a} = {b}"
, not just the individual pieces (e.g."a"
," = "
,"b"
).
I was asking for the expressions for each interpolated segment. E.g. in $"The value is {x + y}"
I would expect "x + y"
as the expression.
comment created time in an hour
Pull request review commentdotnet/csharplang
Clarify scoping and name lookup rules around Global Using directives.
Syntax for a using directive is extended with an optional `global` keyword that can precede the `using` keyword: ```antlr-using_directive- : 'global'? 'using' ('static' | name_equals)? name ';'- ;+compilation_unit+ : extern_alias_directive* global_using_directive* using_directive* global_attributes? namespace_member_declaration*+ ;++global_using_directive+ : global_using_alias_directive+ | global_using_namespace_directive+ | global_using_static_directive+ ;++global_using_alias_directive+ : 'global' 'using' identifier '=' namespace_or_type_name ';'+ ;++global_using_namespace_directive+ : 'global' 'using' namespace_name ';'+ ;+ +global_using_static_directive+ : 'global' 'using' 'static' type_name ';'+ ; ``` -- Global Using Directives are allowed only on the Compilation Unit level (cannot be used inside a namespace declaration).-- Global Using directives, if any, must precede any non-global using directives. -- The scope of a Global Using Directive extends over the namespace member declarations and non-global using directives of all compilation units within the program.-The scope of a Global Using Directive specifically does not include other Global Using Directives. Thus, peer Global Using Directives or those from a different+- The *global_using_directive*s are allowed only on the Compilation Unit level (cannot be used inside a *namespace_declaration*).+- The *global_using_directive*s, if any, must precede any *using_directive*s. +- The scope of a *global_using_directive*s extends over the namespace member declarations and *using_directive*s of all compilation units within the program.+The scope of a *global_using_directive* specifically does not include other *global_using_directive*s. Thus, peer *global_using_directive*s or those from a different compilation unit do not affect each other, and the order in which they are written is insignificant.++# Scopes +https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#scopes++These are the relevant bullet points with proposed additions (which are **in bold**):+* The scope of name defined by an *extern_alias_directive* extends over the ***global_using_directive*s,** *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing compilation unit or namespace body. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the compilation unit or namespace body in which it occurs.+* **The scope of a name defined or imported by a *global_using_directive* extends over the *using_directive*s, *global_attributes* and *namespace_member_declaration*s of all the *compilation_unit*s in the program.**++# Namespace and type names+https://github.com/dotnet/csharplang/blob/master/spec/basic-concepts.md#namespace-and-type-names++Changes are made to the algorithm determining the meaning of a *namespace_or_type_name* as follows.++This is the relevant bullet point with proposed additions (which are **in bold**):+* If the *namespace_or_type_name* is of the form `I` or of the form `I<A1, ..., Ak>`:+ * If `K` is zero and the *namespace_or_type_name* appears within a generic method declaration ([Methods](classes.md#methods)) and if that declaration includes a type parameter ([Type parameters](classes.md#type-parameters)) with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within a type declaration, then for each instance type `T` ([The instance type](classes.md#the-instance-type)), starting with the instance type of that type declaration and continuing with the instance type of each enclosing class or struct declaration (if any):+ * If `K` is zero and the declaration of `T` includes a type parameter with name `I`, then the *namespace_or_type_name* refers to that type parameter.+ * Otherwise, if the *namespace_or_type_name* appears within the body of the type declaration, and `T` or any of its base types contain a nested accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments. If there is more than one such type, the type declared within the more derived type is selected. Note that non-type members (constants, fields, methods, properties, indexers, operators, instance constructors, destructors, and static constructors) and type members with a different number of type parameters are ignored when determining the meaning of the *namespace_or_type_name*.+ * If the previous steps were unsuccessful then, for each namespace `N`, starting with the namespace in which the *namespace_or_type_name* occurs, continuing with each enclosing namespace (if any), and ending with the global namespace, the following steps are evaluated until an entity is located:+ * If `K` is zero and `I` is the name of a namespace in `N`, then:+ * If the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the namespace named `I` in `N`.+ * Otherwise, if `N` contains an accessible type having name `I` and `K` type parameters, then:+ * If `K` is zero and the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N` and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with a namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with a namespace or type,** then the *namespace_or_type_name* is ambiguous and a compile-time error occurs.+ * Otherwise, the *namespace_or_type_name* refers to the type constructed with the given type arguments.+ * Otherwise, if the location where the *namespace_or_type_name* occurs is enclosed by a namespace declaration for `N`:+ * If `K` is zero and the namespace declaration contains an *extern_alias_directive* or *using_alias_directive* that associates the name `I` with an imported namespace or type, **or any namespace declaration for `N` in the program contains a *global_using_alias_directive* that associates the name `I` with an imported namespace or type,** then the *namespace_or_type_name* refers to that namespace or type.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.+ * Otherwise, if the namespaces and type declarations imported by the *using_namespace_directive*s and *using_alias_directive*s of the namespace declaration contain more than one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* is ambiguous and an error occurs.+ * **Otherwise, if the namespaces and type declarations imported by the *global_using_namespace_directive*s and *global_using_static_directive*s of any namespace declaration for `N` in the program contain exactly one accessible type having name `I` and `K` type parameters, then the *namespace_or_type_name* refers to that type constructed with the given type arguments.**
I would expect that if a global using adds one definition of A and a regular using adds a different definition of A, then lookup would be ambiguous.
That is an option, but I am proposing a different approach. We will discuss this at LDM and make the decision.
In reply to: 589639148 [](ancestors = 589639148)
comment created time in an hour