sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Discriminated union containing optional properties and generic types is not narrowed
Labels: Possible Improvement

# Bug Report

I would have expected `doesNotNarrow` (below) to also be able to narrow `x.b` to `NonUndefined<B>`.

### 🔎 Search Terms

generic, narrow, discriminated, union, optional

### 🕗 Version & Regression Information

This is the behavior in every version I tried, and I reviewed all the FAQ for entries.

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?#code/C4TwDgpgBAcg9gOwKoICYQGYEsEVQHgBUA+KAXikKggA9gI0BnKAVzUxzygH4pcA3CACcoALkoAoCaEhQAGvgCCAGigAhUhQDeUAIbj4ydtlwFFxVQCNu4gcKgBfKAB8oO3Tb4RBQqwcQo6CZ4+BqOUhhsAMbAWIhQqHAQjDC6QkJwAO4AFDTiCggsALaWwqqFJcLEAJRuElBQWBhQuQB0uuRkFGxBnKi1WvUNUFGIjMBQIORQNK2WQ8NQAPRLUAB63ENOEg4R0bHxicnwwKnpWUqqGrn5l+o1dQ1NLbMdXd3GfQMLI2MTUxRZvNFg0VutNg1trsJEA)

### 💻 Code

```ts
 type NonUndefined<T> = T extends undefined ? never : T

type X<A, B> = { a: NonUndefined<A>, b?: never } | { a?: never, b: NonUndefined<B> }

function doesNarrow(x: X<number, number>) {
  if (x.a === undefined) {
    const y = x.b
      // ^? number
  } 
}

function doesNotNarrow<A extends number, B extends number>(x: X<A, B>) {
  if (x.a === undefined) {
    const y = x.b
      // ^? NonUndefined<B> | undefined
  } 
}
```

### 🙁 Actual behavior

`x.b` was not narrowed.

### 🙂 Expected behavior

I expected `x.b` to be narrowed because if `x.a` is `undefined`, then `x` must be the latter part of the discriminated union because `x.a` can only be `undefined` there. TypeScript seems to be able to work that out when the type parameters are constant/non-generic (see `doesNarrow`), but for some reason it's not able to work it out for the generic case (even though `NonUndefined` should make it feasible).
Repository: rust
Issue: Inconsistent borrow-checking errors based on function return type
Labels: C-bug,A-implied-bounds

I tried this code:

```rust
struct Foo<'a, 'b>(&'a u8, &'b u8);

struct Bar<'a, 'b>(&'a u8, &'b u8);

impl<'a, 'b> Bar<'a, 'b> {
    fn f1() -> &'a [Foo<'a, 'b>] {
        &[]
    }
    
    fn f2() {
        Self::f1();
    }
    
    fn f3() -> &'a [Foo<'a, 'b>] {
        Self::f1();
        &[]
    }
}
```

I expected to see this happen: Either both `f2()` and `f3()` to build without errors, or both generate errors.

Instead, this happened: only `f2()` generates an error. `f3()` is built without errors:

```
   Compiling borrow-test v0.1.0 (/Users/yakubin/src/borrow-test)
error: lifetime may not live long enough
  --> src/lib.rs:11:9
   |
5  | impl<'a, 'b> Bar<'a, 'b> {
   |      --  -- lifetime `'b` defined here
   |      |
   |      lifetime `'a` defined here
...
11 |         Self::f1();
   |         ^^^^^^^^^^ requires that `'b` must outlive `'a`
   |
   = help: consider adding the following bound: `'b: 'a`

error: could not compile `borrow-test` due to previous error
```

### Meta
`rustc --version --verbose`:
```
rustc 1.66.0 (69f9c33d7 2022-12-12)
binary: rustc
commit-hash: 69f9c33d71c871fc16ac445211281c6e7a340943
commit-date: 2022-12-12
host: aarch64-apple-darwin
release: 1.66.0
LLVM version: 15.0.2
```
(Checked on Rust Playgrounds that it's also reproduced on Rust nightly.)

`f2()` building should imply `f3()` building and vice versa, since they only differ by their return types, but the error is in a line that has nothing to do with whatsoever being returned.
Repository: storybook
Issue: Code snippets not working correctly when prop and slot have same name (7.1.0-alpha-42)(Vue 3)
Labels: bug,vue3,upgrade:7.1

# The Issue
This [pull request](https://github.com/storybookjs/storybook/pull/22518#), whilst solving some issues, seems to have included a bug that causes code snippets to generate incorrect code if a prop has the same key as a slot. 

# Example

For example, I have the following story:

```
export const IconOnly: Story = {
  ...Default,
  args: {
    icon: 'pi pi-check'
  }
}
```

which outputs this code snippet:
```
<template>
  <Button icon="()=>({})" />
</template>
```

where, in previous versions, it output:
```
<template>
  <Button icon="pi pi-check"/>
</template>
```

# Project Setup

I am using Storybook (7.1.0-alpha-42) with Vue 3 (3.3.4) and PrimeVue component library (3.29.2).

This is happening with the use of the Button component which has an 'icon' prop and an 'icon' slot. If I were to take a guess I'd think that the slot and prop having the same name is causing the problem.

Here's the API for the component https://primevue.org/button/.

Happy to send across full file's if it makes things easier.

_Originally posted by @rstainsby in https://github.com/storybookjs/storybook/issues/22518#issuecomment-1619309414_
Repository: neovim
Issue: nvim_parse_cmd with pcall() may throw invalid expression errors
Labels: bug,api,vimscript

### Problem

`nvim_parse_cmd` with `pcall` may invalid expression errors

### Steps to reproduce

1. Run `nvim --clean`
2. Run ``:lua pcall(vim.api.nvim_parse_cmd, 'edit `=`', {})``
3. `E15: Invalid expression: "`"`

### Expected behavior

The error should be captured by the `pcall()`

### Neovim version (nvim -v)

v0.10.0-dev-678+gf660b7948

### Vim (not Nvim) behaves the same?

N/A

### Operating system/version

Arch Linux

### Terminal name/version

kitty 0.28.1

### $TERM environment variable

xterm-kitty

### Installation

build from repo
Repository: flutter
Issue: Unnecessary save/restore of attributes in DisplayListBuilder::drawDisplayList
Labels: engine,P3,team-engine,triaged-engine

This code used to be necessary when the builder itself did a saveLayer around the DrawDisplayListOp record, but that implementation detail has now been pushed to the dispatchers so the code that flanks the `Push` call is very likely now obsolete and should be removed. The code is not wrong, but it may be doing wasted work.

https://github.com/flutter/engine/blob/b5282b08951344e5f4b6eaf1c8e5ee153bb9ee9e/display_list/dl_builder.cc#L1092

This issue is a reminder to address this minor code change after we finally land https://github.com/flutter/engine/pull/43698. Note that that PR is on its 5th revert/reland so far.

Note that there is a small chance that removing the attribute save/restore here will cause some regressions (doubtful, but possible) and so it would be better to wait until after the above PR gets through its revert/reland phase to deal with this change.
Repository: pytorch
Issue: Support ONNX opset 20 to export GELU to one single op
Labels: module: onnx,triaged,OSS contribution wanted

### 🚀 The feature, motivation and pitch

ONNX added GELU (and its tanh approximation ) as a new op in its opset 20: https://github.com/onnx/onnx/blob/main/docs/Operators.md#Gelu

It will be great to upgrade Pytorch ONNX export to support it. Model visualization and GELU pattern matching will be a lot easier.

### Alternatives

_No response_

### Additional context

_No response_
Repository: PowerToys
Issue: RUN: 1. Add keyboard shortcuts as search results &  2. custom programs that can read what the user typed
Labels: Product-PowerToys Run,Needs-Triage

### Description of the new feature / enhancement

1. I open PT Run, type in Navigate back, it performs Alt+Left, or Open edge Command Pallete, perform Ctrl + Q, etc. Allows users to configure custom shortcuts
2. I type in Send email to, and it lets me pass the whole input to a program as a command line attribute.

### Scenario when this would be used?

To allow users to integrate with other apps easily via keyboard or command line

### Supporting information

_No response_
Repository: stable-diffusion-webui
Issue: [Feature Request]: HyperDreamBooth
Labels: enhancement,extension-request

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

Implement HyperDreamBooth in Automatic1111 as an extension.

### Proposed workflow

Function the same as Dreambooth extension but using Hyper Dreambooth instead.


### Additional information

_No response_
Repository: tensorflow
Issue: Unable to hide TPUs
Labels: stat:awaiting tensorflower,type:bug,comp:tpus,TF 2.12

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

binary

### TensorFlow version

2.12

### Custom code

No

### OS platform and distribution

Kaggle Notebooks

### Mobile device

_No response_

### Python version

3.8

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Unable to hide TPUs from TensorFlow. The consequence of this is that if we want to use JAX along with TensorFlow, only one of them will be able to initialize the TPU system, and the other will fail. We won't be able to use `tfds`, `tf.image` or any TF operation per se if we can't hide TPUs from being used by TF. I want all these operations to run on CPU only, and leverage JAX for TPU. Here is the code to test it on a TPU machine:

```python
import tenorflow as tf

tf.config.set_visible_devices([], device_type="TPU_SYSTEM")
tf.config.set_visible_devices([], device_type="TPU")

print(tf.config.list_logical_devices())

# output:
# [LogicalDevice(name='/device:CPU:0', device_type='CPU'),
#  LogicalDevice(name='/device:TPU_SYSTEM:0', device_type='TPU_SYSTEM'),
#  LogicalDevice(name='/device:TPU:0', device_type='TPU'),
#  LogicalDevice(name='/device:TPU:1', device_type='TPU'),
#  LogicalDevice(name='/device:TPU:2', device_type='TPU'),
#  LogicalDevice(name='/device:TPU:3', device_type='TPU'),
#  LogicalDevice(name='/device:TPU:4', device_type='TPU'),
#  LogicalDevice(name='/device:TPU:5', device_type='TPU'),
#  LogicalDevice(name='/device:TPU:6', device_type='TPU'),
# LogicalDevice(name='/device:TPU:7', device_type='TPU')]
```

This also doesn't work:

```python
physical_devices = tf.config.list_physical_devices()
tf.config.set_visible_devices(physical_devices[0], 'CPU')
```

### Standalone code to reproduce the issue

```shell
import tenorflow as tf

tf.config.set_visible_devices([], device_type="TPU_SYSTEM")
tf.config.set_visible_devices([], device_type="TPU")

print(tf.config.list_logical_devices())

# This also doesn't work:
physical_devices = tf.config.list_physical_devices()
tf.config.set_visible_devices(physical_devices[0], 'CPU')



### Relevant log output

_No response_
Repository: kubernetes
Issue: code-generator generated ApplyScale requires a non exsiting package
Labels: kind/bug,sig/api-machinery,sig/autoscaling,area/code-generation,triage/accepted

### What happened?

1. add `// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale` for the type
2. generate code with `client` and `applyconfiguration`

The generated _clientset_ code imports a package like `../client/applyconfiguration/autoscaling/v1`, but `applyconfiguration` doesn't generate the `../client/applyconfiguration/autoscaling/v1` package

### What did you expect to happen?

The generated `ApplyScale` works

### How can we reproduce it (as minimally and precisely as possible)?

Generate `ApplyScale` for custom types.

### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
```
v1.22.17
</details>


### Cloud provider

<details>
None
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>
Repository: material-ui
Issue: Tabs indicator's wrong position when using direction: rtl
Labels: bug 🐛,component: tabs

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Steps to reproduce 🕹

Link to live example:
https://codesandbox.io/s/mui-tabs-indicator-wrong-position-vxfjq2?file=/demo.js

Steps:

1. The issue is reproduced already in the Codesandbox instance. the problem is the `direction: rtl` in the theme (line: 59) and when you comment that line you can see that the indicator is displayed correctly.

### Current behavior 😯

The position of the indicator is not correct in small screens and when we have overflow in the tabs container. 

https://github.com/mui/material-ui/assets/62181905/5a46e43d-a696-42cb-9912-19fd6d572725



### Expected behavior 🤔

It must be displayed correctly:)

### Context 🔦

_No response_

### Your environment 🌎

Using the codesandbox above.
Repository: tauri
Issue: [bug] load image file by asset protocol from smb will hang the entire application.
Labels: type: bug,status: needs more info,status: needs triage

### Describe the bug

I am using `convertFileSrc` to load local file, the app run properly when I load file from local disk. But if I load file from remote source, it will hang the entire application until the file loaded.
I load file by smb protocol, path like this `\\home.haoyuanlord.net\media\pexels-roberto-nickson-2559941.jpg`
this will be obvious when load 100mb+ files at the same time.
file load not just hang current window, other windows also were freezed, so I think maybe the rust-end was blocked.

### Reproduction

[reproduction repo](https://github.com/a1156883061/tauri-net-load)

### Expected behavior

the app run normally when load the image files

### Platform and versions

```text
[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 114.0.1823.82
    ✔ MSVC: Visual Studio ���ɹ��� 2019
    ✔ rustc: 1.66.0 (69f9c33d7 2022-12-12)
    ✔ Cargo: 1.66.0 (d65d197ad 2022-11-15)
    ✔ rustup: 1.25.1 (bb60b1e89 2022-07-12)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.12.1
    - pnpm: 8.6.7
    - yarn: 3.6.1
    - npm: 8.19.2

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: default-src 'self'; img-src 'self' asset: https://asset.localhost
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite
```


### Stack trace

_No response_

### Additional context

_No response_
Repository: next.js
Issue: Unalterable Light-Dark Settings on `learn/foundations` Page
Labels: bug

### Verify canary release

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

### Provide environment information

```bash
The bug is happening on nextjs learn page, https://nextjs.org/learn/foundations/about-nextjs.
```


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

_No response_

### Link to the code that reproduces this issue or a replay of the bug

https://nextjs.org/learn/foundations/about-nextjs

### To Reproduce

Unalterable Light-Dark Settings on `learn/foundations` Page, https://nextjs.org/learn/foundations/about-nextjs.

https://github.com/vercel/next.js/assets/92412722/9a3222f1-a3db-4a0e-909d-312c7fd85ed4



### Describe the Bug

Unalterable Light-Dark Settings on `learn/foundations` Page, https://nextjs.org/learn/foundations/about-nextjs.

### Expected Behavior

It should alterable Light-Dark settings on `learn/foundations` page.

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

Google Chrome 114.0.5735.198 (official version) (arm64)

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

_No response_
Repository: godot
Issue: Godot Closes when restoring a minimized floating script editor window (Intel driver bug)
Labels: bug,platform:windows,topic:rendering,confirmed,topic:thirdparty,crash

### Godot version

4.1 - stable

### System information

Godot v4.1.stable - Windows 10.0.22621 - Vulkan (Compatibility) - Intel(R) HD Graphics 4400 () - Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz (4 Threads)

### Issue description

Godot Closes when restoring a minimized floating script editor window

### Steps to reproduce

Enable floating script window

![image](https://github.com/godotengine/godot/assets/104901333/bebbb768-9fcd-4127-85e4-b7911d44f31a)

minimize the window and try restoring it. 


https://github.com/godotengine/godot/assets/104901333/3727a6e9-d22c-4ef5-99f8-4fec39224569



### Minimal reproduction project

Engine based problem
Repository: PowerToys
Issue: Additional Feature in PowerRename
Labels: Needs-Triage

### Description of the new feature / enhancement

I suggest adding a case toggle for PowerRename which keeps the unaffected text in it's existing case style.

For example: I currently have a filename "NPV-115A Cover Page" if I want to change "115" to "116" the only allowed results are as follows: "npv-115a cover page", "NPV-115A COVER PAGE", "Npv-115a Cover Page" where as replacing only the related text should result in "NPV-115A Cover Page"

### Scenario when this would be used?

This would be used in all cases where the text is already in a case-type that the user wants but they need to change a single sub-string.

### Supporting information

_No response_
Repository: material-ui
Issue: Tooltip's Arrow Position
Labels: component: tooltip

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Summary 💡

I want to position the tooltip's arrow just like the tooltip 'placement' prop. For example, when I use "bottom-start" and if the children of the tooltip are long, the arrow is positioned to the right, but I want to position it on the left. Am I missing that feature or is there no option for that?

<img width="217" alt="image" src="https://github.com/mui/material-ui/assets/32303129/4c934542-1b28-49e1-b51d-a3b80549a0b4">

There is an issue for that https://github.com/mui/material-ui/issues/37651
But the solution is not reusable. I do not know always my tooltip's width. (according to the language and for some different usage on different pages)


### Examples 🌈

_No response_

### Motivation 🔦

_No response_
Repository: flutter
Issue: Investigate CodeQL (code scanning) support
Labels: team-infra,P3,infra: security,triaged-infra

- https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/#frameworks-and-libraries
- https://github.blog/changelog/2023-01-09-code-scanning-can-be-set-up-more-easily-without-committing-a-workflow-file-to-the-repository/

See https://github.com/dart-lang/sdk/issues/52953 for the Dart-specific issue
Repository: vscode
Issue: Option to scroll a fixed, whole number of lines with the mouse wheel
Labels: feature-request,editor-scrollbar

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

The current default behaviour for mouse wheel scrolling in VS code is to scroll just under three lines. There exists an `editor.mouseWheelScrollSensitivity` option that can be changed to make this scroll a whole number of lines, but if that's what you want, this value ends up being obtuse and varies depending on font size.

e.g. I've found that at font size 13, an `editor.mouseWheelScrollSensitivity` of `1.08` will scroll three lines, but `1.12` is needed for font size 14.

I would appreciate a new setting that allows the user to specify how many lines to scroll by explicitly, this could even be fractional and allow scrolling two and a half lines for example.
Repository: pytorch
Issue: [docs] torch.sigmoid to make clear equivalence relations to other sigmoid functions
Labels: module: docs,triaged,actionable

### 📚 The doc issue

Currently https://pytorch.org/docs/stable/generated/torch.sigmoid.html only points to https://pytorch.org/docs/stable/special.html?highlight=expit#torch.special.expit

Both do not link to https://pytorch.org/docs/stable/generated/torch.nn.Sigmoid.html?highlight=sigmoid#torch.nn.Sigmoid or https://pytorch.org/docs/stable/generated/torch.Tensor.sigmoid.html?highlight=sigmoid#torch.Tensor.sigmoid

https://pytorch.org/docs/stable/special.html?highlight=expit#torch.special.expit (and other special functions) should deserve their own `.html` pages btw (as all other functions). expit should mention explicitly if it's just an alias to torch.sigmoid and torch.nn.functional.sigmoid

Ideally all these function variants should just say "See [some single variant]" (maybe to torch.sigmoid? or torch.nn.Sigmoid as it contains currently the function plot)

Currently there exists 4 functional variants (without considering quantized variants) and 1 module variant and findable in docs:
- torch.sigmoid
- torch.Tensor.sigmoid
- torch.nn.functional.sigmoid
- torch.special.expit
- torch.nn.Sigmoid

As usual, search results also contain duplicates and snippets are quite bad (it even finds sth like `[FXE0004:fx-pass-convert-neg-to-sigmoid]` - I would say that Sphinx search should not index code examples/source code itself - only text) :(
<img width="305" alt="image" src="https://github.com/pytorch/pytorch/assets/1041752/adc1ff18-1ebf-45b4-be62-1ac6577d6b87">


### Suggest a potential alternative/fix

_No response_

cc @svekars @carljparker
Repository: three.js
Issue: Loading VideoTexture in WebXR gives camera feed instead of actual video
Labels: Enhancement

### Description

I have a THREE.PlaneGeometry that has a videotexture on it, and I position it using the hit detection from WebXR just by touching the screen. No problems. But if I enable camera-access from WebXR, the texture will become the live camera feed. I want to be able to have the camera image, while also having the normal videotexture and 3D scene.


### Reproduction steps

1. Open the 1st Github page. You should see an app that uses WebXR to position a video with hit detection when you touch the screen. No problems at all.
2. Open the 2nd Github page. The only difference is that I removed the comment from the camera-access in the required features of WebXR, and now the videotexture becomes the live camera feed. 


### Code

const videoTexture = new THREE.VideoTexture(video);
...
navigator.xr
      .requestSession("immersive-ar", {
        requiredFeatures: ["camera-access", "hit-test", "local"],
        optionalFeatures: ["dom-overlay"],
        domOverlay: { root: document.getElementById("overlay") },
      })
.then(onSessionStarted, onRequestSessionError);

### Live example

* https://schaldach.github.io/video-texture-demo/
* https://schaldach.github.io/video-texture-demo-camera-access/

### Screenshots
No camera-access:
![Screenshot_20230717-095243_Chrome](https://github.com/mrdoob/three.js/assets/127117445/1308b8b0-be75-455d-a36b-baa44ba38576)

Camera-access:
![Screenshot_20230628-092102_Chrome (1)](https://github.com/mrdoob/three.js/assets/127117445/4985a731-46b0-4453-981e-78536fb43906)
![Screenshot_20230626-085834](https://github.com/mrdoob/three.js/assets/127117445/374ac492-aa63-4c00-95ba-fadcaa4a7ca9)


### Version

0.147.0

### Device

Mobile

### Browser

Chrome

### OS

Android