sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Couple apparent bugs with variance checking
Labels: Bug,Help Wanted

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

variance, methods, generics

NB: I did not search very exhaustively, but I did minimize the examples, so should be pretty easy to review and close as dupe or "by design" or whatever.

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about `strictFunctionTypes`

### ⏯ Playground Link

Variance checking does not interact correctly with `extends`:

https://www.typescriptlang.org/play?#code/C4TwDgpgBAYgPAewK7CgQQDRWagQgPigF4o4ANKCAD2AgDsATAZ3WPXwAoA3ALijICUxQrgBQogMYI6TVAEM+8OhC4QATlmWq1hEl2FQuk6bKgAjRXDpIAtmfWaV63VDnGZqNRCZIANsD4tdTYzDgAWACYhAHpoqAB3AAsEBDAmIA

Variance checking does not interact correctly with "records with methods" types:

https://www.typescriptlang.org/play?#code/C4TwDgpgBAGgPAewK7CgZQHxQLxQN4BQUUAHgBQDOAXOgJQ0B2EAbhAE4EC+BBAxggwqoAhjXhNWbLLjykaFHFgXd+g1ACMxcJAwDWDBAHcG0qML4ChUQwAsECMNSgT2OKOoB05ACwAmWgRAA

### 💻 Code

Variance checking does not interact correctly with `extends`:

```typescript
type F<out A, out B> = <X extends A = A>(v: X) => B

const a: F<never, never> = v => v
const b: F<unknown, never> = a
const result: never = b(42) // whoops
```

Variance checking does not interact correctly with "records with methods" types:

```typescript
type X<out S> = {
  x(s: S): never
}

const a: X<never> = { x: s => s }
const b: X<unknown> = a
const whoops: never = b.x(42)
```

### 🙁 Actual behavior

In both cases the typechecker allows me to inhabit `never`.

### 🙂 Expected behavior

The typechecker should reject my incorrect variance annotations (`F<out A, ...>` and `X<out S>`) and not allow me to inhabit `never`.

---

Incidentally this came to light out of some discussion in the "forall for non-functions" issue here: https://github.com/microsoft/TypeScript/issues/17574#issuecomment-1465094919, but these things don't really seem materially related.

Related to #48240.
Repository: godot
Issue: Godot 4 is making scenes corrupt (Failing to load multiple child scenes from the same parent scene)
Labels: bug,topic:editor,needs testing

### Godot version

4.0 stable

### System information

Linux Mint 21.1 Cinnamon, Graphics: Intel Corporation HD Graphics 620, Processor: Intel© Core™ i5-7200U CPU @ 2.50GHz × 2

### Issue description

I am trying to transfer a project from godot 3.5.1 to 4.0,
I found that a specific arrangement present in file (bug.zip) is causing all the instances from preloads (except the **first** preload) in the (Tools.gd) autoload to become null instances
then on **Reloading the current project** the scenes that were giving null instances are now shown as corrupt

**Note:** funny thing is that if you re-arrange the order of the preloads (instead of preloading `Pencil.tscn` first, you preload `Eraser.tscn` first, then the `Pencil.tscn` will fail to load)

**Another Note:** this phenomena mysteriously disappears if you comment out `line 5` of `BaseTool.gd` (replace it with `pass` or `return`)

### Steps to reproduce

1. Unzip `Bug.zip` and open it in Godot 4
2. Follow the instructions in the video and create scenes **Pencil.tscn** and **Eraser.tscn** as shown in the video
3. Run the scene (you will get a null instance error)
4. Check the **Eraser.tscn** and verify that it's not corrupt, reload the project (now **Eraser.tscn** will be shown as corrupt)
5. Ignore it's corruption and change the preload order (Place **Eraser.tscn** first and **Pencil.tscn** second), now **Pencil.tscn** will give a null instance
6. Reload the project again (**Eraser.tscn** will somehow fix itself and **Pencil.tscn** will now be shown as corrupt)

https://user-images.githubusercontent.com/77773850/224527752-5de5be6b-36ca-417a-95ec-661239aa06cb.mp4



### Minimal reproduction project

[Bug.zip](https://github.com/godotengine/godot/files/10950098/Bug.zip)
Repository: stable-diffusion-webui
Issue: [Bug]: 
Labels: bug-report

### Is there an existing issue for this?

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

### What happened?

I had an old version, which went through the same issue but I somehow eventually recovered. I've forgotten how, and bare with me because I do not really care nor have the smarts for python stuff. This old version also for some reason didn't have any working extensions

I used the Stable Diffusion WebUI for a bit, then moved onto NMKD's stable diffusion gui. I have been using this for a while WITH the WebUI additionally installed with no issues whatsoever until today where I decide to update, the original WebUI folder was still there but I had just renamed it thinking that'll be fine.

After the git bash was completed, I deleted the old webui folder and started the webui-user.bat in the new one, but came across the dreaded error. THIS IS WEIRD, BECAUSE JUST MOMENTS BEFORE ON THE OLDER VERSION, EVERYTHING WAS FINE

Could this be because of my NMKD SD gui? I know that they both use python or whatever.

### Steps to reproduce the problem

I don't know? I'm hoping you'll tell me the steps to haev the opposite

### What should have happened?

The WebUI should've started

### Commit where the problem happens

The current version at the time of this issue from the Git bash

### What platforms do you use to access the UI ?

Windows

### What browsers do you use to access the UI ?

Brave

### Command Line Arguments

```Shell
no
```


### List of extensions

additional networks
multiple hypernetworks
wd14-tagger
txt2mask
txt2vectorgraphics

### Console logs

```Shell
exit code: 1

stderr:
C:\Users\End User\AppData\Local\Programs\Python\Python310\python.exe: No module named pip

Launch unsuccessful. Exiting.
Press any key to continue . . .
```


### Additional information

NMKD SD Gui starts up fine. The OLDER version of the SD gui starts up fine. Why is it only now being completely stupid? God I hate computers
Repository: stable-diffusion-webui
Issue: [Feature Request]: I hope developers can add a button to quickly change the name of the model~
Labels: enhancement

### 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 ?

It's just a simple feature. Allows me to edit the model name in the WebUI model card interface.
![image](https://user-images.githubusercontent.com/72326927/224527846-2f24a3d8-e6b5-44db-b62f-3f44093de194.png)
Just give me a small button in the bottom right corner of the card to allow me to edit the name~
So that I don't have to look in the folder separately and then modify.

### Proposed workflow

1. Go to “show extra networks”
2. Press “change name” to edit a new name for a model


### Additional information

_No response_
Repository: material-ui
Issue: Component styling not working with renderToStaticMarkup 
Labels: external dependency,package: styled-engine

### 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/autumn-morning-3mdyj7?file=/demo.tsx


### Current behavior 😯

Not sure how to reopen closed issue, so I open another one (https://github.com/mui/material-ui/issues/33864 and https://github.com/emotion-js/emotion/issues/2102 )

The emotion cache is not getting styles, so it's not possible to inject them back to the 'actual' react node.

 

### Expected behavior 🤔

_No response_

### Context 🔦

We have in our React application components done in javascript that can have some custom renderers done in React (small components). We need to get the html of those and inject in javascript, including styling. 

If it counts for something we have a paying license, thanks.

### Your environment 🌎

_No response_
Repository: go
Issue: x/mobile: unix.Connect() return network is unreachable
Labels: NeedsInvestigation,mobile

<!--
Please answer these questions before submitting your issue. Thanks!
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.20.2 linux/amd64
</pre>

Gomobile latest version, using:

```
$ go install golang.org/x/mobile/cmd/gomobile@latest
```

### Does this issue reproduce with the latest release?

yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/aztecrabbit/.cache/go-build"
GOENV="/home/aztecrabbit/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/aztecrabbit/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/aztecrabbit/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/aztecrabbit/Developments/Golang/test_unix/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2974479168=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on go.dev/play is best.
-->

```go
package main

import (
	"fmt"
	"net"

	"golang.org/x/sys/unix"
)

func main() {
	fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_STREAM, unix.IPPROTO_TCP)
	if err != nil {
		panic(err)
	}

	ips, err := net.LookupIP("www.google.com")
	if err != nil {
		panic(err)
	}

	sa := &unix.SockaddrInet6{
		Port: 80,
	}
	copy(sa.Addr[:], ips[0])

	err = unix.Connect(fd, sa)
	if err != nil {
		panic(err)
	}

	fmt.Println("Complete without error")
}
```

### What did you expect to see?

```
Complete without error
```

### What did you see instead?

android real device

```
panic: network is unreachable
```

emulator using `context.WithTimeout()` 30 seconds

```
panic: context deadline exceeded
```

this bug is only affecting go 1.20, go 1.19.4 works fine.
Repository: react
Issue: Bug: `createRoot` function from React@18 break the css `:target`
Labels: Status: Unconfirmed

## Keywords

- React 18
- createRoot
- CSS selector
- CSS Target
- :target

<!--
  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: React@18

## Steps To Reproduce

1. open https://joyful-kelpie-c3bb20.netlify.app/buggy.html
2. click `go to react id target` link
3. You should see the `react id target` with green background
4. Refresh page. The green background disappears

<!--
  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:

The webpage source code is simple. You could check the source code directly.

Or, you can check this:
https://gist.github.com/magic-akari/475a13219394fb938cff4169a9b61eb7


<!--
  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
CSS target selector does not work.
The green background disappears after refresh pages.

## The expected behavior

CSS target selector should work after refresh pages.

See: https://joyful-kelpie-c3bb20.netlify.app/ok.html
Repository: flutter
Issue: TextSpan rendering incorrectly when having TextStyle
Labels: framework,engine,a: typography,has reproducible steps,P2,found in release: 3.7,found in release: 3.9,team-engine,triaged-engine

## Enviroument
```
Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2ad6cd72c0 (4 days ago) • 2023-03-08 09:41:59 -0800
Engine • revision 1837b5be5f
Tools • Dart 2.19.4 • DevTools 2.20.1
```


## Issue
While the children of a `TextSpan` contain `TextSpans` that only have `\n` as `text` content and do not have any `TextStyle`, for example:

```dart
[
  TextSpan(inherit: true, height: 2.0x, "abc."),
  TextSpan(inherit: true, height: 2.0x, "   "), 
  TextSpan("\n"), 
  TextSpan(inherit: true, height: 2.0x, "de"),
]
```

It produces some strange behavior, as shown in the screen recording. The cursor moves to the end of the preceding non-whitespace character while inserting whitespace.   
This issue does not occur when adding whitespace at the end of the text(Adding whitespaces after `de`).

https://user-images.githubusercontent.com/5637609/224534019-7a11c15e-ec6e-44cb-846c-ee9c0f5eac1e.mov



## Code snippet

```dart
...
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Markdown Editor'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(20.0),
        child: TextField(
          controller: MyController(text: "abc\nde"),
          maxLines: null,
        ),
      ),
    );
  }
...

// This controller just simply groups whitespaces, newlines and other characters
class MyController extends TextEditingController {
  MyController({String text = ''}) : super(text: text);

  @override
  TextSpan buildTextSpan({
    required BuildContext context,
    required bool withComposing,
    TextStyle? style,
  }) {
    List<String> parts = [];
    String current = "";
    for (int i = 0; i < text.length; i++) {
      final char = text[i];
      final isOnlyWhitespaces = RegExp(r'^[ ]+$').hasMatch(current);

      if (current.isEmpty) {
        current += char;
        continue;
      }

      if (char == '\n') {
        parts.add(current);
        parts.add(char);
        current = '';
      } else if (char != ' ') {
        if (isOnlyWhitespaces) {
          parts.add(current);
          current = '';
        }
        current += char;
      } else {
        if (!isOnlyWhitespaces) {
          parts.add(current);
          current = '';
        }
        current += char;
      }
    }

    if (current.isNotEmpty) {
      parts.add(current);
    }

    final children = parts
        .map(
          (text) => TextSpan(
              text: text,
              style: text == '\n' ? null : const TextStyle(height: 2)),
        )
        .toList();
    print(children);

    return TextSpan(style: style, children: children);
  }
}
```
Repository: pytorch
Issue: Tensor Permutation Along Given Axis
Labels: feature,triaged,module: python frontend

### 🚀 The feature, motivation and pitch

The current `torch.perm` gives shared permutation ordering like the example below:
```python
import torch

# permute on the second dimension
x = torch.randn(3, 5, 4)
perm = torch.randperm(x.size(dim))
shuffled_x = x[:, perm, :]
```
The perm will shuffle the second dimension in the same ordering that is given by perm, which is the same of each other dimensions. 

It will be nice to have a function that permutes that given dimension of `x` **independently**.

### Alternatives

I've write a possible solution that has been tested by myself, and it works as intended.

```python
import torch

def shuffle_tensor(x: torch.Tensor, dim: int = 0) -> torch.Tensor:
    """
    Shuffle the tensor along the specified dimension independently 
    for each slice along that dimension.
    
    [NOTE] this is different to torch.perm which is shared permutation ordering.
    
    For example, for a 2D tensor:
        x = tensor([[0, 0, 1, 6, 2],
                    [5, 4, 7, 2, 4]])
            
    Aftering shuffling `x` becomes:
            tensor([[0, 0, 6, 2, 1],
                    [5, 7, 2, 4, 4]])
                    
    This works for any given dimension `dim` for an arbitary shape input tensor `x`.
    
    Args:
        x (torch.Tensor): The tensor to shuffle.
        dim (int, optional): The dimension along which to shuffle. Default is 0.

    Returns:
        torch.Tensor: The shuffled tensor.
    """
    # Get the shape of the slice of x along the specified dimension
    x_shape = tuple(x.shape[:dim+1])

    # Get the indices that would sort a random tensor along the specified dimension
    indices = torch.argsort(torch.rand(x_shape), dim=dim)
    
    # Add singleton dimensions to indices to match the shape of x
    n = x.dim() - dim - 1   
    indices = indices[(..., ) + (None,) * n] 
    indices = indices.to(x.device) * torch.ones_like(x)
    indices = indices.long()
    
    # Shuffle the tensor using gather
    shuffled_x = torch.gather(x, dim=dim, index=indices)
    return shuffled_x
```

Hopefully this can be added to the pytorch update.

Thanks,
Jie

### Additional context

_No response_

cc @albanD
Repository: rust
Issue: macro parses `let` keyword as pattern and fails + masked regression
Labels: P-low,A-macros,T-compiler,C-bug

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code:

```rust
macro_rules! let_let_oof {
    ($p:pat) => {
        let_let_oof! { let let $p }
    };
    (let let $p:pat) => {
        fn a() {
           let $p = 5; 
        } 
    }
}

let_let_oof! { x }
```

I expected the code to compile and the macro to expand as follows:
```rust
fn a() {
  let x = 5;
}
```

Instead, compilation failed:
```text
error: expected pattern, found `let`
  --> bad-code2.rs:3:24
   |
3  |         let_let_oof! { let let $p }
   |                        ^^^ help: remove the unnecessary `let` keyword
...
12 | let_let_oof! { x }
   | ------------------ in this macro invocation
   |
   = note: this error originates in the macro `let_let_oof` (in Nightly builds, run with -Z macro-backtrace for more info)

error: expected identifier, found keyword `let`
  --> bad-code2.rs:3:28
   |
3  |         let_let_oof! { let let $p }
   |                            ^^^ expected identifier, found keyword
...
12 | let_let_oof! { x }
   | ------------------ in this macro invocation
   |
   = note: this error originates in the macro `let_let_oof` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors
```

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.70.0-nightly (8a73f50d8 2023-03-11)
binary: rustc
commit-hash: 8a73f50d875840b8077b8ec080fa41881d7ce40d
commit-date: 2023-03-11
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7
```

Occurs on latest stable and nightly.

### Additional context
I believe there are two issues here:
1. (error 2) The parser consumes `let` as an identifier and then fails because it is not a valid identifier; `Parser::can_be_ident_pat` (see `compiler/rustc_parse/parser/pat.rs:811`) returns true on keywords and then the caller (`compiler/rustc_parse/parser/pat.rs:398`) attempts to parse an ident pattern and promptly fails because it sees a keyword.
2. (error 1) On top of this (and thus no code has been broken), a regression occurred with the introduction of the following code (see `compiler/rustc_parse/parser/pat.rs:345`) which eagerly consumes tokens without being behind a `Parser::may_recover` gate (this is similar to #107796, that regression I caused, right? cc @compiler-errors):
```rust
if self.token.is_keyword(kw::Let) && self.look_ahead(1, |tok| tok.can_begin_pattern()) {
    self.bump();
    self.sess.emit_err(RemoveLet { span: lo });
    lo = self.token.span;
}
```

If this is correct, I'd like to PR it please :).
Repository: vscode
Issue: Make the Command Palette show the keybindings corresponding to the command being displayed
Labels: feature-request,keybindings

<!-- ⚠️⚠️ 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. -->

As a VS Code user who has bound keyboard shortcuts to a command I want the Command Palette to keep showing the shortcuts bound to the command that will be executed if I select the command there.

Instead VS Code shows my custom keybindings. Which will make different things happen if I use the keybindings shown than if I select the menu item in the palette.

**An example**: Calva by default provides the keybindings `ctrl+alt+c ctrl+alt+c` for the `calva.connect` command id called without any arguments. If  I bind a shortcut to the same command id like so:

```json
    {
        "command": "calva.connect",
        "args": {"disableAutoSelect": true},
        "key": "ctrl+alt+c shift+c",
    },
```

Then the command palette will start showing that shortcut:

<img width="611" alt="image" src="https://user-images.githubusercontent.com/30010/224537345-a058cde3-b682-489e-ac13-03da64178bd1.png">

I think it would be much better if VS Code could keep showing the right shortcut for the command being executed if the menu item is selected. Even better would be if I could configure the shortcut so that it it appears in the command palette under its own title.
Repository: deno
Issue: feat: view test coverage in editor
Labels: feat,help wanted,lsp,testing

Deno
- can run tests.
- can generate test coverage reports.
- has an an editor integration (LSP).

It would be amazing if VSCode would **display the test coverage right inside the editor**.

The line coverage results are very useful when writing tests because they let me easily see which case are covered by tests and which ones are not. However, every time I add a test to cover some more code, I need to run `deno test` and `deno coverage` and then reload my browser window.

I am aware that there are third-party tools that should be able to consume the LCOV output and do this, but I would prefer if it would “just work” without any additional configuration.