sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: querySelector('a') has a return type of HTMLAnchorElement | null, but should be HTMLAnchorElement | SVGAElement | null
Labels: Suggestion,Awaiting More Feedback

# Bug Report


### 🔎 Search Terms

querySelector HTMLAnchorElement

### 🕗 Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about querySelector

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ssl=5&ssc=16&pln=1&pc=1#code/MYewdgzgLgBBBuBzGBeGATEwCuBbApmFAHTABO+AhlPgKIA2+BRAcgMoAUARABZRQAHAFwB6EQHdJxcQGZiIMohEAmAAzqRCRFwA0MLlq4BKANwAoUJFiVUGLHkIlyVGgyaP23PoNESps+UUVdVVNJF19SmMzLWJKAQFCdABhHgBLenQOSlMLcGgYADMQbDB0N2ZYNFiAR2x8MgBPNnxGYCgFDgBySi7cywgQRmJ6EERs0yA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
const a = document.createElementNS("http://www.w3.org/2000/svg", "a")
svg.appendChild(a);
const foundElement = svg.querySelector('a');
console.log(a);
```

### 🙁 Actual behavior

TypeScript is convinced that `foundElement` has type `HTMLAnchorElement | null`, despite it actually being an `SVGAElement`.

### 🙂 Expected behavior

TypeScript should recognize that `foundElement` has type `HTMLAnchorElement | SVGAElement | null`.

I think the fix could be to combine the overloads. Currently, it is
```ts
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
```

It could instead be
```ts
querySelector<K extends (keyof HTMLElementTagNameMap) | (keyof SVGElementTagNameMap)>(selectors: K):
  | (K extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[K] : never)
  | (K extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[K] : never)
  | null;
```
Repository: PowerToys
Issue: Characters such as "ɑ̄" cannot be displayed correctly.
Labels: Issue-Bug,Area-User Interface,Needs-Repro,Product-Quick Accent

### Microsoft PowerToys version

0.65.0

### Installation method

PowerToys auto-update

### Running as admin

Yes

### Area(s) with issue?

Quick Accent

### Steps to reproduce

![屏幕截图 2022-12-10 142422](https://user-images.githubusercontent.com/35188269/206835705-e91ba770-bd3f-4ac7-8bb7-7c507f0c54a7.png)
(in Simlified Chinese environment)Characters such as "ɑ̄" cannot be displayed correctly.

### ✔️ Expected Behavior

Characters such as "ɑ̄" can be displayed correctly.

### ❌ Actual Behavior

Characters such as "ɑ̄" cannot be displayed correctly.

### Other Software

_No response_
Repository: next.js
Issue: Hydration issue occurs only IOS by automatically converting numbers to 'a' tag
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

Bug occurs only IOS(mobile safari, Mobile Safari UI/WKWebView, Instagram, ...)

### Which area(s) of Next.js are affected? (leave empty if unsure)

_No response_

### Link to the code that reproduces this issue

https://github.com/gusrb3164/next-hydration-debug

### To Reproduce

1. npm run dev
2. enter the localhost:3000 with Iphone safari

### Describe the Bug

Error log: Text content did not match. Server: "test : name name test : " Client: "test : name name test : 111-11-11111"

I entered the numbers in p tag.

```jsx
<p>
    <br />
    test : name name test : 111-11-11111
</p>
```

The actual variable root.containerInfo.childNodes was converted into a tag as shown in the picture below.

![image](https://user-images.githubusercontent.com/34272561/206841771-51468139-7f18-4813-9b2d-68c5b5dd129f.png)


### Expected Behavior

There is no cause for the hydration issue, but it is occurring.

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_
Repository: godot
Issue: PoolStringArrays cannot be pattern matched
Labels: enhancement,discussion,topic:gdscript

### Godot version

3.5.1.stable

### System information

Linux carbon-x1 6.0.11-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Dec 2 20:38:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

### Issue description

It appears that `PoolStringArray` cannot be used for pattern matching:

```
var arr = PoolStringArray()
arr.append("one", "two")

match arr:
  ["one", var rest]: ...
  _: ...
```

This will always fall through to the `_` case.

This works when first converting it back to an `Array`:

```
match Array(arr):
  ...
```

This is surprising behavior since from the developer's perspective, the backing store for an array is an implementation detail and a match expression should be able to account for that?

### Steps to reproduce

See description

### Minimal reproduction project

N/A
Repository: pytorch
Issue: Operator overload priority should not rely on static initialization order
Labels: oncall: jit

### 🐛 Describe the bug

In our internal build, calling `torch.ops.aten.add()` on two scalar float tensors will incorrectly return a Python native integer (instead of a float tensor).

### Root Cause:
I found this is because the operator overloads for `aten::add` looks like this:
```
print(torch._C._jit_get_operation('aten::add'))

(<built-in method add of PyCapsule object at 0x7fb54234aae0>, ['t', 'str', 'int', 'complex', 'float', 'int_complex', 'complex_int', 'float_complex', 'complex_float', 'int_float', 'float_int', '', 'Tensor', 'out', 'Scalar', 'Scalar_out'])
```

while in a correct build, the output should look like this:
```
(<built-in method add of PyCapsule object at 0x7fb231070930>, ['Tensor', 'Scalar', 'out', 'Scalar_out', 't', 'str', 'int', 'complex', 'float', 'int_complex', 'complex_int', 'float_complex', 'complex_float', 'int_float', 'float_int', ''])
```
i.e., the `Tensor` overload must come before the "int" overload.

If I'm not mistaken, the operator overload priority is defined by the order they are registered - which is defined by the ambiguous static initialization order. In particular, the `Tensor` overload for `aten::add` is registered in https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/templates/RegisterSchema.cpp while the `int` overload is registered in https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/runtime/register_prim_ops.cpp.


### Versions

I'm building pytorch 1.13.1-rc1

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel
Repository: angular
Issue: TestBed.overrideComponent doesn't update standalone components
Labels: area: testing,P3,bug,cross-cutting: standalone

### Which @angular/* package(s) are the source of the bug?

core

### Is this a regression?

No

### Description

This removes imports - expected.
```ts
TestBed.overrideComponent(StandaloneComponent, {
  set: {
    imports: [],
  },
});
```

This doesn't change imports - unexpected.
```ts
TestBed.overrideComponent(StandaloneComponent, {
  set: {
    imports: [FakeTestingModule],
  },
});
```

There is stackblitz example - simply copy/paste the `test.spec.ts` to an angular v15 (v14 has his issue too) project.

### Please provide a link to a minimal reproduction of the bug

https://github.com/satanTime/ng-mocks/blob/issues/4486/tests/issue-4486/angular.spec.ts

### Please provide the exception or error you saw

_No response_

### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 15.0.3
Node: 16.18.1
Package Manager: npm 8.19.3
OS: darwin x64

Angular: 15.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1500.3
@angular-devkit/build-angular   15.0.3
@angular-devkit/core            15.0.3
@angular-devkit/schematics      15.0.3
@schematics/angular             15.0.3
rxjs                            7.6.0
typescript                      4.8.4
webpack                         5.75.0
```


### Anything else?

_No response_
Repository: next.js
Issue: UTF-8 routes in `pages` isn't recognized
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

yarn run v1.22.19
$ /home/maxswjeon/projects/next-route-utf8/node_modules/.bin/next info

    Operating System:
      Platform: linux
      Arch: x64
      Version: #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022
    Binaries:
      Node: 18.12.1
      npm: 9.1.2
      Yarn: 1.22.19
      pnpm: 7.14.2
    Relevant packages:
      next: 13.0.7-canary.4
      eslint-config-next: 13.0.6
      react: 18.2.0
      react-dom: 18.2.0

Done in 1.38s.

### Which area(s) of Next.js are affected? (leave empty if unsure)

_No response_

### Link to the code that reproduces this issue

https://github.com/maxswjeon/next-route-utf8

### To Reproduce

**From Scratch**
1. Run `yarn create next-app`
    1. Use npm or pnpm if you want rather than yarn
    2. Upgrade to canary if you want
2. Add a route in `pages` folder by adding a file named `tēst.tsx` with this content
    ```typescript
    export default function TestPage() {
      return <h1>Tēst Page</h1>;
    }
    ```
4. Run `yarn dev`
5. Go to `localhost:3000/tēst`
6. Meet the 404 error
7. Add a route in `pages` folder by adding a file named `t%C4%93st.tsx` with this content
    ```typescript
    export default function TestEncodedPage() {
      return <h1>Tēst Encoded Page</h1>;
    }
    ```
8. Go to `localhost:3000/tēst`
9. Meet the `Tēst Encoded Page`

**From example**
1. Clone the example repo by `git clone https://github.com/maxswjeon/next-route-utf8`
2. Run `yarn install && yarn dev`
3. Go to `localhost:3000/tēst`
4. Meet the `Tēst Encoded Page`


### Describe the Bug

Next should internally handle percent-encoded URLs for developer experience

### Expected Behavior

**From Scratch**
1. Run `yarn create next-app`
    1. Use npm or pnpm if you want rather than yarn
    2. Upgrade to canary if you want
2. Add a route in `pages` folder by adding a file named `tēst.tsx` with this content
    ```typescript
    export default function TestPage() {
      return <h1>Tēst Page</h1>;
    }
    ```
4. Run `yarn dev`
5. Go to `localhost:3000/tēst`
6. Meet the `Tēst Page`

**From example**
1. Clone the example repo by `git clone https://github.com/maxswjeon/next-route-utf8`
2. Run `yarn install && yarn dev`
3. Go to `localhost:3000/tēst`
4. Meet the `Tēst Page`


### Which browser are you using? (if relevant)

Chrome 108.0.5359.99 (Official Build) (64bit)

### How are you deploying your application? (if relevant)

_No response_
Repository: rust
Issue: Return `impl for<'a> Fn(&'a)` incorrectly rejected for closures
Labels: A-closures,C-bug,A-coercions,T-types

I ran into a compile error while writing some iterator adapters involving building (types containing) closures in a function returning (types containing) `impl for<'a> Fn(&'a)`, which I narrowed down to the following example:

```rust
fn const_if_unit(input: bool) -> impl for<'a> FnOnce(&'a ()) {
    if input {
        |_| ()
    } else {
        |_| ()
    }
}
```

This function fails to typecheck, seemingly because the return type is inferred to only implement `Fn(&())` rather than `for <'a> Fn(&'a ())`.
Note that replacing the body with an unconditional `|_| ()` instead works as expected, and using functions rather than closures also compiles without errors, see [playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=246a1e6dfc48aa15545dd58b996118fe) for more examples.
I'm on Rust 1.65.0 but the playground shows the same happening in beta and nightly too.

Seems related to #99991 and maybe #98437 (that I could find), but they are about trait bounds in input types rather than return `impl`, and here it actually does work as long as the closure is returned unconditionally, though feel free to close as duplicate if it's ultimately the same root issue.

<details><summary>`cargo check` output</summary>
<p>

```
error[E0308]: mismatched types
 --> repro/src/main.rs:2:19
  |
2 |       if input {
  |  ___________________^
3 | |         |_| ()
4 | |     } else {
  | |_____^ one type is more general than the other
  |
  = note: expected trait `for<'b> FnOnce<(&'b u8,)>`
             found trait `FnOnce<(&u8,)>`

error: implementation of `FnOnce` is not general enough
 --> repro/src/main.rs:2:19
  |
2 |       if input {
  |  ___________________^
3 | |         |_| ()
4 | |     } else {
  | |_____^ implementation of `FnOnce` is not general enough
  |
  = note: `fn(&'2 u8)` must implement `FnOnce<(&'1 u8,)>`, for any lifetime `'1`...
  = note: ...but it actually implements `FnOnce<(&'2 u8,)>`, for some specific lifetime `'2`

error: higher-ranked lifetime error
 --> repro/src/main.rs:4:12
  |
4 |       } else {
  |  ____________^
5 | |         |_| ()
6 | |     }
  | |_____^
```

</p>
</details>
Repository: vscode
Issue: "Ctrl + d" doesn't respect "Match Case" and "Match Whole Word"
Labels: bug,editor-multicursor

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.74.0
- OS Version: Ubuntu 22.04.1

Steps to Reproduce:

1. Open any file.
2. Press `Ctrl + F` and toggle `Off` both `Match Case` and `Match Whole Word`. Close the `Find` popup.
3. Move your cursor over any word you want to do multiple selection on.
4. Start pressing `Ctrl + D` as many times as you like. (Don't select the first word by double clicking your mouse or using `Ctrl + Shift + Left/Right Arrow`! First selection must be done using `Ctrl+D` for this bug to appear.)
5. Here is where the bug appears. Notice how in the small popup you can see that both `Match Case` and `Match Whole Word` are toggled `On` even though you toggled them both `Off` in step 2.

If instead of the keyboard shortcut `Ctrl + D` you use the command `Add Selection To Next Find Match` from the command palette then you would also get this bug, but not really. Notice that `Match Case` and `Match Whole Word` are toggled `On` as in step 5. Keep using the same command from the command palette and notice how both `Match Case` and `Match Whole Word` change to 'Off' state as in the step 2. Highlighted text also changes.

Finally, if you select the first word using your mouse or `Ctrl + Shift + Left/Right Arrow` then everything works fine. `Match Case` and `Match Whole Word` are respected in whatever state they were set in step 2.
Repository: godot
Issue: AssetLib stuck in "loading" for 60s
Labels: bug,topic:editor,confirmed,topic:assetlib

### Godot version

v4.0.beta8.official

### System information

macOS 12.5.1 (21G83), MacBook Pro (2020, intel)

### Issue description

When opening Godot editor on a new (or existing) project, switching to the AssetLib is somehow delaying the loading of the assets to install.

Looking with wireguard, I can see some initial communication taking place with godotengine.com, but nothing affecting the AssetLib screen. Then exactly 60 seconds after that initial communication, there is activity again, finally resulting in the list being displayed.

I have repeated this a few times, the 60s delay was happening every time. I guess this is some kind of periodic polling interval on that screen?

Anyhow: seems like, the first request is always failing, resulting in the user needing to wait for 60s until the list is requested again.

See screenshots for some impressions:

**loading screen in AssetLib, new project**
![1-loading](https://user-images.githubusercontent.com/114500633/206856865-5b9d9479-f035-43c5-91ee-7220f8fd8664.png)

**wireshark: initial request at t=42, second request at t=102**
![2-wireshark](https://user-images.githubusercontent.com/114500633/206856889-14eb0d82-b042-46c2-a9a2-fca426d81aa5.png)

**godotengine.org ip address lookup**
<img width="453" alt="3-godotengine-ip" src="https://user-images.githubusercontent.com/114500633/206856992-1530a741-db89-4719-9af3-9b16e361c514.png">



### Steps to reproduce

1. open godot editor with a new project
2. navigate to the AssetLib tab
3. list is only displaying "Loading ..."
4. wait for 60s
5. list is now populated

### Minimal reproduction project

create a new project
Repository: godot
Issue: Godot freezing when trying to load shader
Labels: bug,topic:editor,topic:shaders

### Godot version

4.0 (beta 7)

### System information

Windows 10

### Issue description

Godot freezes when trying to open a scene that has a specific shader.

The shader is the following

```
shader_type canvas_item;

uniform float random_number = 1.0;
uniform sampler2D noise_tex : repeat_enable;
uniform vec4 color : source_color = vec4(0.5,0.3,0.3,1.0);

void fragment(){
    vec4 noise = texture(noise_tex ,UV + vec2(0.4,0.4) * TIME random_number) + vec4(0.2,0.2,0.2,0.2);
    vec4 ctex = texture(TEXTURE,UV) color;
    COLOR = noise * ctex;
}
```

Adding the shader to a scene works fine, trying to load a scene with the shader (either at start-up or afterwards) causes a freeze.

### Steps to reproduce

1) Create a scene and add a sprite
2) Add the shader to the sprite
3) Save as main scene
4) Close Godot
5) Re-open the project

### Minimal reproduction project

N/A
Repository: pytorch
Issue: `torch.inverse` multi-threading RuntimeError: lazy wrapper should be called at most once
Labels: triaged,module: multithreading,module: linear algebra

### 🐛 Describe the bug

`torch.inverse` and the related modules won't work with multi-threading:

```py
import concurrent.futures
import torch

def run_task(req):
    out = torch.inverse(torch.eye(4, device="cuda:0"))
    return req, out


infer_tasks = [1, 2, 3, 4, 5, 6, 7, 8]

with concurrent.futures.ThreadPoolExecutor(4, "BatchTask") as executor:
    futures = {executor.submit(run_task, t) for t in infer_tasks}
    for fut in concurrent.futures.as_completed(futures):
        print("outcome", fut.result())

```

run this script will raise a runtime error:
```
Traceback (most recent call last):
  File "my_test.py", line 15, in <module>
    print("outcome", fut.result())
  File "/home/anaconda3/envs/py38/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/home/anaconda3/envs/py38/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/home/anaconda3/envs/py38/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "my_test.py", line 5, in run_task
    out = torch.inverse(torch.eye(4, device="cuda:0"))
RuntimeError: lazy wrapper should be called at most once
```

### Versions

Collecting environment information...
PyTorch version: 1.13.0+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.10.2
Libc version: glibc-2.27

Python version: 3.8.13 (default, Mar 28 2022, 11:38:47)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: 11.4.48
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA TITAN Xp COLLECTORS EDITION
GPU 1: NVIDIA TITAN Xp COLLECTORS EDITION


(monai ref: https://github.com/Project-MONAI/MONAI/issues/5696)

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano
Repository: godot
Issue: [4.0 beta] Creating PackedScene duplicates its internal children
Labels: bug,topic:editor

### Godot version

4.0 beta

### System information

linux

### Issue description

Hi,
In the editor, I want to create a PackedScene from a branch of my Tree. This branch contains internal children. When I create the scene, its internal children remains but are duplicated with new non internal ones.

### Steps to reproduce

Launch the minimal test project below

Create an InternalParent node
Right click on it and make it a Scene
Look at the new scene's tree and at the console output

I could not find how to avoid this behaviour.
Thanks for your help !

### Minimal reproduction project

[test_duplicate_internals.zip](https://github.com/godotengine/godot/files/10200340/test_duplicate_internals.zip)