sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Narrowing discriminated union via type predicate and type assertion results in different behavior.
Labels: Needs Investigation

# Bug Report

### 🔎 Search Terms
type predicate discriminated union

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about v4.5.0-dev.20210907

### ⏯ Playground Link
[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.5.0-dev.20210907#code/CYUwxgNghgTiAEYD2A7AzgF3gMxgVwEsMAueAb3gGsCVhSByKAByYhHoF94AfcqmuvHoAjKCjFR68LrwrVaDMAAsQMGAE8pHAFDbQkWAmx4UYDAVTwCaAPIoQN7AB4AKgBp4AVXggAHhhBaNHgXAD4ACiIQAFtSd3hYGCh1UjgoYFQIdS8AbQBdAEpSKOirYM9tAmx4SNt7R3DcQgwAOnlgDxzGFjZ6DxEJcXo8hODkdAwCgvJteDmcfCI2gXgAelWhZlZ2HiFRcSHZ+aaiNY25AQYt3pk+doZ9iS1di4UhZVUNLW0uEAg0BBkI5zE6tdpnd4qNSaYELZoQ16CbrbTgvfhvAYHSTSNH3SGfTTSH66fTQOA4ExmCwoMoAERA2BoUSydgczni3j8ASCIQiJTiHkSyVSIHSmWynnyRVGAJgGGCJTKXkqaHpjJQzPUrIaoOWtE6yN6-UeQxGUDGqEwBW0uvB602PR2vExTxtiyw9sRV0dqNk6KRJuxOiAA)

### 💻 Code

```ts
declare const fruit: { kind: 'apple'} | { kind: 'banana' } | { kind: 'cherry' }

declare function isOneOf<T, U extends T>(item: T, array: readonly U[]): item is U
if (isOneOf(fruit.kind, ['apple', 'banana'] as const)) {
    fruit.kind // 'apple' | 'banana'
    fruit // { kind: 'apple'} | { kind: 'banana' } | { kind: 'cherry' }
} else {
    fruit.kind // 'cherry'
    fruit // { kind: 'apple'} | { kind: 'banana' } | { kind: 'cherry' }
}

declare function isDefinitelyOneOf<T, U extends T>(item: T, array: readonly U[]): asserts item is U
isDefinitelyOneOf(fruit.kind, ['apple', 'banana'] as const)
fruit.kind // 'apple' | 'banana'
fruit // { kind: 'apple'} | { kind: 'banana' }
```

### 🙁 Actual behavior
Type assertion does the correct thing, but the equivalent type predicate results in an odd scenario where the property is *correctly* narrowed, but the union object is not narrowed.

### 🙂 Expected behavior
Type assertion and type predicate have the same narrowing behavior, and only differ on whether the code branches or throws.

I would also expect the type predicate to either narrow neither the property nor the object or both the property and the object (like the type assertion does).
Repository: create-react-app
Issue: Configure react/webpack to ignore `http2`
Labels: stale,needs triage

Hi 👋,

I am working on a library that is mainly used in node, but is also useful in browser applications (in part).
To test browser compatibility we have two test apps, one in angular one in react.
We recently added a dependency that uses `http2` and `dns`, but can basically be ignored in browsers.

I was able to correctly configure webpack 5 and 6 with angular, while for webpack 5, I had to add this to the `package.json`:
```json
"browser": {
  "http2": false,
  "dns": false
}
```
Adding it to a custom webpack config did not work (as opposed to webpack 6).

React seems to use webpack 5. Adding a `browser` configuration to the `package.json` did not work, neither did ejecting the react config and extending the webpack config.
The default webpack config provided by react actually contains `http2`: 'empty`, however I always get this error:

```
Failed to compile.

./node_modules/http2-wrapper/source/index.js
Cannot find module: 'http2'. Make sure this package is installed.
```

How can I disable the two node.js modules?
Repository: create-react-app
Issue: Bug:  when i run react locally the on network ip address is not correct 
Labels: stale

<!--
  Please provide a clear and concise description of what the bug is. Include
  screenshots if needed. Please test using the latest version of the relevant
  React packages to make sure your issue has not already been fixed.
-->

React version:
^17.0.2
## Steps To Reproduce

when i run react npm start (this worked correctly before updating node) after the latest update, the on network ip address ignore the wireless connection and always puts the Ethernet card ip address
<!--
  Your bug will get fixed much faster if we can run your code and it doesn't
  have dependencies other than React. Issues without reproduction steps or
  code examples may be immediately closed as not actionable.
-->

Link to code example:

<!--
  Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a
  repository on GitHub, or provide a minimal code example that reproduces the
  problem. You may provide a screenshot of the application if you think it is
  relevant to your bug report. Here are some tips for providing a minimal
  example: https://stackoverflow.com/help/mcve.
-->

## The current behavior

when i run react npm start (this worked correctly before updating node) after the latest update, the on network ip address ignore the wireless connection and always puts the Ethernet card ip address
## The expected behavior
puts the real ip address in my local network
Repository: godot
Issue: [TRACKER] Moving arrays of properties edition to the Inspector.
Labels: enhancement,topic:editor,tracker

### Godot version

master

### Issue description

Since https://github.com/godotengine/godot/pull/52277 is implemented, we can now move several arrays of properties to this new system. This tracker aims to list all properties to either expose, move from a custom editor, or format as an array in the inspector. Basically, anythings that would benefit from the new property arrays implementation can go here.

So here is the list:
- [x] ItemList node items (https://github.com/godotengine/godot/pull/54342)
- [x] OptionPopup node items (https://github.com/godotengine/godot-proposals/issues/368 )
- [ ] MeshLibrary resource items
- [x] Tabs node items
- [ ] AnimatedTexture frames


Potential includes to discuss:
- [ ] AnimationPlayer
- [ ] SpriteFrames animations
- [ ] Gradients points
- [ ] LayeredTexture
...


Don't hesitate to comment anything you would like to be added here.
Repository: rust
Issue: Fails to parse boolean expression of nested match expressions
Labels: A-diagnostics,A-parser,T-compiler,D-confusing,D-terse

I tried this code (reduced to minimal triggering case):

```rust
fn main() {
    let (a, b, c) = (3, 4, 5);
    let r: bool = match c {
        _ => match a {
            _ => true
        } && match b {
            _ => true,
        },
    };
}
```
([Failing in playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f0f28cb5552d7dcabe60164d620d2f53))

Fails with the following error:
```
error: expected identifier, found keyword `match`
 --> src/main.rs:7:14
  |
7 |         } && match b {
  |              ^^^^^ expected identifier, found keyword

error: expected one of `=>`, `@`, `if`, or `|`, found `b`
 --> src/main.rs:7:20
  |
7 |         } && match b {
  |                    ^ expected one of `=>`, `@`, `if`, or `|`

error: aborting due to 2 previous errors
```

However, the following works as expected:
```rust
fn main() {
    let (a, b, c) = (3, 4, 5);
    let r: bool = match a {
        _ => true,
    } && match b {
        _ => true,
    };
}
```

Given that the second example compiles, we should expect the first one to compile as well.

### Meta

I've found this issues on all rust versions 1.54.0 to 1.57 nightly inclusive. It doesn't look like a regression, since the same code is rejected as far back as 1.30, just with a different error message.
Repository: kubernetes
Issue: Use go-cmp/cmp only in tests
Labels: kind/feature,sig/architecture,lifecycle/frozen,area/code-organization,triage/accepted

I propose that we try to limit the use of go-cmp/cmp primarily to tests.

The comparisons themselves are less efficient, and referencing the cmp package may allocate some static structures.

Where we can't easily avoid calling cmp, I propose we limit its usage.  If we are calling it from a V(4) log statement (for example), we should first check whether the log level is active.
Repository: kubernetes
Issue: Pods that are terminating but force deleted must still be accounted for in admission
Labels: kind/bug,sig/node,lifecycle/frozen,triage/accepted

A pod can be created, allocated unique resources on a node (such as a volume, an isolated CPU, or a device), and then force deleted.  Force deletion however happens independent of the state of the Kubelet - the pod could still be running or not have completed termination (termination takes a non-zero amount of time from request to completion).  A pod that is force deleted should still be visible to admission checks and other Kubelet loops until the pod is actually terminated.

There are two main admission loops - hard admission (which rejects the pod from the node immediately) and soft admission (which happens each time the pod is synced and might result in the pod being stopped temporarily) - which both need to take into account resources that are allocated but no longer in the list of "all pods".

Depending on the admission plugin, there may be different requirements about what information is necessary.  For instance, if an admission plugin allocates resources only for running pods, then the plugin needs only pods that should or could have running containers (desired pods + terminating pods).  If the admission plugin allocates resources for volumes or the entire pod, then the plugin needs to know (desired pods + non-terminal pods).

Currently, both use cases are handled identically, which means admission plugins often make direct calls to Kubelet manager functions, which could result in inconsistencies.  Both cases are do not include pods that are force deleted, even those those pods may have running containers or be non-terminal.

## Probable change

The current list of "all admitted pods" is served by GetActivePods() on the kubelet.  This list is the set of observed desired configuration pods (every pod passed to HandlePodUpdates is added to the pod manager, regardless of admission status), which is filtered by:

1. pod is in a terminal state from the config source (pod phase = failed or succeeded)
2. pod is in a terminal state because it was rejected by admission (statusManager pod phase = failed or succeeded) - regressed in #103668, fixed in #104817 
3. pod has been detected to complete termination by the kubelet pod worker (pending terminal phase) - fixed in #103668

However, this list needs to change to the union of all pods known to the pod manager and all pods known to the pod workers (which includes pods that have been force deleted), filtered by:

1. pod is in a terminal state from the config source
2. pod is in a terminal state from admission
3. pod is in terminal state from the pod workers

The `OtherPods` entry on the pod admission list would then correctly show pods still consuming resources.  An admission plugin that depends only on running pods could then make calls to the pod worker via an appropriate method (or we could split OtherPods).
Repository: godot
Issue: AnimationPlayer key editing NodePath throw an error
Labels: bug,topic:editor,topic:animation

### Godot version

3.3.stable

### System information

Windows 10

### Issue description

Editing an AnimationPlayer's key when the value is a NodePath can throw an error depending on the position of the AnimationPlayer in the tree compared to the edited Node.

for example, following this tree hierarchie:
- Node (root)
  - Node (scripted with an export NodePath)
    - Node1
    - Node2
  - AnimationPlayer

if we create a key in the AnimationPlayer node, tracking the scripted Node's NodePath var, and edit the AnimationTrackKeyEdit's value, targeting for example Node1, an error will be throw like:
 
```
(Node not found: "Node/Node1" (relative to "/root").)
 editor/animation_track_editor.cpp:77 - Condition "!np_node" is true.
```
Maybe what I'm trying to do is not supposed to work and is intended, but I then wouldn't get why.

### Steps to reproduce

- Launch the reproduction project bellow
- select AnimationPlayer
- select a key
- edit the key value, targeting for example one of the MeshIntance
- see that an error is thrown

### Minimal reproduction project

[animationplayer_nodepath.zip](https://github.com/godotengine/godot/files/7123375/animationplayer_nodepath.zip)
Repository: neovim
Issue: custom highlighting in completion popup menu
Labels: enhancement,ui,completion

### Feature already in Vim?

No

### Feature description

Preferably custom highlight groups could work in completion popup menu.

At minimal, there should be different highlight groups for `text`, `kind` and `extra`.

Motivation: Make something like this achievable: https://github.com/hrsh7th/nvim-cmp/issues/141
Repository: godot
Issue: AnimationTrackKeyEdit value missing for property added using _get_property_list
Labels: bug,topic:editor,topic:animation

### Godot version

3.3.stable

### System information

Windows 10

### Issue description

AnimationPlayer key will miss the possibility to edit `Value` (under AnimationTrackKeyEdit) if the property was added using `_get_property_list()` (`"usage"` matching the value of an `export` var)

### Steps to reproduce

Using the project bellow, you can see under AnimationPlayer node, two variable in the timeline:
- `a` property, `export`
- `b` property, added via `_get_property_list` (same `"usage"` value as an `export` var)

If you look at the AnimationTrackKeyEdit for both properties key, you will see that you are able to edit `Value`  for `a` property, and that `Value` is missing for `b` property.

### Minimal reproduction project

[animationplayer_property_list.zip](https://github.com/godotengine/godot/files/7123992/animationplayer_property_list.zip)
Repository: material-ui
Issue: Serving CSS styles externally using @material-ui/styles in SSR applications
Labels: support: question,package: styles

I use @material-ui/styles in a SSR project and the problem is each page CSS styles are added internally.

Are there any ways that CSS styles be used externally (i.e. in separate CSS files)?

- [x] The issue is present in the latest release.
- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.
Repository: opencv
Issue: Python opencv net.forwardAsync doesn't return all output layers
Labels: category: dnn

<!--
If you have a question rather than reporting a bug please go to https://forum.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 4.2
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2017
-->

- OpenCV => 4.5
- Operating System / Platform => Windows
- Compiler => This is the version of OpenCV that comes with OpenVINO.  If it is compiling anything, it's probably using Visual Studio.

##### Detailed description

In python, net.forwardAsync is only returning one output layer from a yolo network.

##### Steps to reproduce

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->
```
net = cv2.dnn.readNetFromDarknet(cfg, weights)
net.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE)
net.setInput(blob)
a = net.forwardAsync()

while not a.valid():
  time.sleep(1/1000)

print(a.get().shape)
```

prints `(768, 16)`, but in fact the output should be two blobs, one of shape (192, 16) and one of shape (768, 16).

Furthermore, I cannot pass in an array of layer names, and, strangely, if I pass in the name of the smaller output layer, a.valid() never returns true.
Repository: vscode
Issue: Status bar: draw rounded corner at the focus line
Labels: help wanted,feature-request,workbench-status

<!-- ⚠️⚠️ 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.59.1
- OS Version: macOS Big Sur 11.5.2

Steps to Reproduce:

1. Put focus on the `status bar`

<img width="183" alt="CleanShot 2021-09-07 at 16 34 38@2x" src="https://user-images.githubusercontent.com/9604296/132407611-955dbe54-bb02-4aec-ab38-5d25c09ba90b.png">
Missing rounded corner at the focus line
Repository: vscode
Issue: [Live Share: Guest initiated debugging] You don't have an extension for debugging .....
Labels: feature-request,debug

<!-- ⚠️⚠️ 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?: No

<!-- 🪓 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. -->
Version: 1.60.0 (user setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.18363

Steps to Reproduce:

1. Live Share host starts a collaboration session
2. Live Share guest joins session
3. Live Share guest attempts to initiate debugging

Hi @isidorn: there are a bunch of similar issues that are already closed. I've seen your responses that adding the debug adapter's supported debugger "languages"  to the package.json resolves [the issue](https://github.com/microsoft/vscode/issues/123881).


The live share guest's debug adapter should support all languages that the host can debug though. So we would need to add every possible language so that the debug request could be forwarded to the host. If the guest is in a launch.json file they see this though: 

![image](https://user-images.githubusercontent.com/8161247/132421047-dd68b78c-2622-4b6b-b524-3a37c84f449a.png)

Is there a wildcard option for all languages or a way to disable this new restriction for the Live Share guest?
Repository: godot
Issue: Theme override `background_color` can't be used to make control transparent
Labels: enhancement,topic:gui

### Godot version

3.4.beta4

### System information

Windows 10

### Issue description

It appears that the TextEdit background_color cannot be set to fully transparent in a theme. When this setting is applied, the TextEdit still displays the default blue/purple color. This appears to be the case in both the background color Theme Override, as well as if Color(0, 0, 0, 0) is present in the theme itself.

### Steps to reproduce

1. Create a TextEdit
2. In the inspector, set "Syntax Highlight"=On (required for background_color override to work)
3. Set Theme Overrides -> Colors -> Background Color to something fully transparent
4. TextEdit shows the blue/purple color instead of what's behind it.

### Minimal reproduction project

[transparency.zip](https://github.com/godotengine/godot/files/7124955/transparency.zip)
Repository: terminal
Issue: Quake Mode - Allow Horizontal resizing
Labels: Product-Terminal,Issue-Task,Area-Windowing

<!-- 
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING:
1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement.
2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement.
3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number).
4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement.
5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement.

All good? Then proceed!
-->

# Description of the new feature/enhancement

Currently, the Quake Mode Terminal takes up whole width of the screen and when using it on a wide monitor, this can get cumbersome to use it. Please allow horizontal resizing and allow docking it at the center horizontally - similar to the way ConEmu works.

Worth mentioning another issue already logged here #11125 which causes additional inconvenience while using wide monitor.