sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Needless evaluation of placeholder type when checking that an interface matches a constraint
Labels: Suggestion,Awaiting More Feedback

# Bug Report

### 🔎 Search Terms

type constraint, interface, evaluation, type checker, placeholder type

### 🕗 Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about this

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.9.4#code/C4TwDgpgBAWhBOB7AzgHgHIBooCUoQA9gIA7AE2SgFcSBrExAdxIG0BdKAXinYD4uAsACgooqOnxFSFXCwDkAG1IBzYAAs5HAPy4oALlgIUGbCwAM2AHTWcbXgG5hwgJYli8AGYBDAMbQAJHBIlADeUGYGNPRMJPZQoJAGQcbqzsjmdnEAvk5CCdBeYGAKIIFGlNyFxSCoZcGmAMyZuflQVSW1ACqSxOSh8eAQkXQMzFBZ2ACC8MrI-NwAFP7dAGRQ07MAlPL5mvZAA)

### 💻 Code
Note: the utility type `Zeros` is designed to infinitely recur when it is fed `unknown` in order to exhibit the problem.
```ts
type Zeros<N, R extends unknown[] = []> =
    N extends R['length'] ? R : Zeros<N, [0, ...R]>;

interface $Zeros { 0: unknown; type: Zeros<this[0]>; }

type apply$Zeros = apply<$Zeros, [3]>;
//                 ~~~~~~~~~~~~~~~~~~
// Type instantiation is excessively deep and possibly infinite

type apply<$T extends { type: unknown }, Args> = ($T & Args)['type'];
```

Alternate implementations of `apply` which don't reproduce the error can be found bellow:

```typescript
// no type constraint
type apply<$T, Args> = ($T & Args)['type' & keyof $T];

// type constraint cheking keyof
type apply<$T extends (keyof $T extends keyof Type ? unknown : never), Args> =
    ($T & Args)['type' & keyof $T];
```

### 🙁 Actual behavior

It is my understanding that the type constraint `$T extends { type: unknown }` causes the type checker to evaluate `Zeros<this[0]>` as `Zeros<unknown>`, which leads to infinite recursion.

I believe this evaluation was not necessary because every type extends `unknown`, including `undefined` or `never` (an optional `type` field could also be caught without having to evaluate the value), therefore I consider that `$T extends { type: unknown }` could only check that the `type` key exists in `$T` without relaxing type safety.

I imagine that skipping this evaluation would also improve performance.

The alternative type safe solution of manually checking the existence of the keys is not user friendly.

### 🙂 Expected behavior

`$T extends { type: unknown }` should only check that the `type` field exists and enable to index `$T & Args` with `type` with no unexpected side-effect.
Repository: flutter
Issue: `popRoute()` documentation is misleading 
Labels: framework,d: api docs,f: routes,P2,team-framework,triaged-framework

Documentation of `Future<bool> popRoute()` says:
```
The method should return a boolean [Future] to indicate whether this delegate handles the request. Returning false will cause the entire app to be popped.
```
While this is true for flat Router structure, it is invalid for nested Router structure.
If `popRoute()` in `NestedRouterDelegate` returns `false`, then `entire app` is not popped. The `ParentRouterDelegate` takes charge instead, and on it's `popRoute()` depends what will happen.
Repository: stable-diffusion-webui
Issue: [Bug]: Img2Img Batch mode does not use the output image format
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 used the Batch mode on the Img2Img tab. The source images were JPGs.

### Steps to reproduce the problem

1. Go to Img2Img tab
2. Go to Batch tab
3. Select a folder with JPG images
4. Select a script (I used ABG_Remover extension)
5. I got an error, because it does not save the images as PNG, even though it is set to PNG in Settings.


### What should have happened?

If the PNG format is set in Settings, save to PNG for all saves, also for Batch, or for Batch have a separate option to **keep the original format** or to **use the specified format**.

### Commit where the problem happens

c98cb0f8

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

Windows

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

Google Chrome

### Command Line Arguments

```Shell
--xformers --ckpt-dir V:\!SDModels --ui-config-file 1my/ui-config-my.json --ui-settings-file 1my/config-my.json --autolaunch --gradio-img2img-tool color-sketch
```


### Additional information, context and logs

![image](https://user-images.githubusercontent.com/6390413/213926939-27dcb5ed-1a3e-4671-9534-c91818eef2e0.png)
Repository: stable-diffusion-webui
Issue: [Bug]: Model fallback on colab
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?

My models are on Google drive. It cannot load the latest model, then it gives a fallback for model.ckpt.

### Steps to reproduce the problem

1. mount Google drive with models 
2. Run webUI on Colab

### What should have happened?

Load the last model you used.

### Commit where the problem happens

c98cb0f8ecc904666f47684e238dd022039ca16f

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

Windows

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

Google Chrome

### Command Line Arguments

```Shell
--share --gradio-queue --enable-insecure-extension-access --gradio-debug --gradio-auth me:password --no-half-vae --ckpt-dir /content/drive/MyDrive/SDmodels --vae-dir /content/drive/MyDrive/VAE --lora-dir /content/drive/MyDrive/Lora --esrgan-models-path /content/drive/MyDrive/ESRGAN --ui-config-file /content/drive/MyDrive/1my/ui-config-my.json --ui-settings-file /content/drive/MyDrive/1my/config-my.json --styles-file /content/drive/MyDrive/1my/styles.csv --embeddings-dir /content/drive/MyDrive/TI-Embeddings --hypernetwork-dir /content/drive/MyDrive/Hypernetworks --gradio-img2img-tool color-sketch
```


### Additional information, context and logs

Here is colab log:

Checkpoint elldrethSLucidMix_v10.safetensors [67abd65708] not found; loading fallback model.ckpt
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Downloading: 100% 939k/939k [00:01<00:00, 720kB/s]
Downloading: 100% 512k/512k [00:01<00:00, 473kB/s]
Downloading: 100% 389/389 [00:00<00:00, 407kB/s]
Downloading: 100% 905/905 [00:00<00:00, 702kB/s]
Downloading: 100% 4.41k/4.41k [00:00<00:00, 4.49MB/s]
Calculating sha256 for /content/drive/MyDrive/SDmodels/model.ckpt: fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556
Loading weights [fe4efff1e1] from /content/drive/MyDrive/SDmodels/model.ckpt
Applying cross attention optimization (Doggettx).
Textual inversion embeddings loaded(1): bookmodded 
Textual inversion embeddings skipped(3): kc8, kc32, kc16
Model loaded in 117.9s (12.5s create model, 101.2s load weights).
Checkpoint model.ckpt [fe4efff1e1] not found; loading fallback model.ckpt [fe4efff1e1]
Repository: storybook
Issue: [Feature Request]: Allow plain Markdown for docs files
Labels: feature request,has workaround,addon: docs

### Is your feature request related to a problem? Please describe

I'd like to use plain Markdown instead of MDX for docs pages. This should be pretty easy if `Meta` properties are replaced with front matter properties.

When trying to replace `Introduction.mdx` with `Introduction.md` it seems like the file just isn't processed at all.

### Describe the solution you'd like

```md
title: Example/Introduction
----

# Storybook with Markdown

Plain Markdown files with front matter are pretty great.
```

### Describe alternatives you've considered

_No response_

### Are you able to assist to bring the feature to reality?

yes, I can

### Additional context

_No response_
Repository: flutter
Issue: RootRestorationScope of MaterialApp or MaterialApp.router cannot be overridden as by ancestor's widget
Labels: framework,has reproducible steps,P2,a: state restoration,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

`RootRestorationScope` of `MaterialApp` or `MaterialApp.router` cannot be overridden as by ancestor's widget.
This can be fixed like in 'How to fix:' point but we have two configured `RootRestorationScope` widgets in our tree.

Steps to reproduce

1. Open developer options of your android device and enable Don't keep activities
2. Run the Counter app from the example code below
3. The counter screen is shown
4. Click on the `Increment` button any times
5. Switch on other app on your device/emulator
6. Go back to Counter app

Expected

-  The counter on the counter screen is restored and have the incremented not zero value  

Actual

- The counter screen is shown with the initial zero counter state 

How to fix:

- Add any value to `MaterialApp.restorationScopeId` property that is not the same as your `RootRestorationScope.restorationId`.

Code Sample
```dart
import 'package:flutter/material.dart';

void main() {
  runApp(
    const RootRestorationScope(
      restorationId: 'root',
      child: MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage>
    with RestorationMixin<MyHomePage> {
  final _counter = RestorableInt(0);

  void _incrementCounter() {
    setState(() {
      _counter.value++;
    });
  }

  @override
  void dispose() {
    _counter.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter Demo Home Page'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '${_counter.value}',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }

  @override
  String get restorationId => 'counter';

  @override
  void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
    registerForRestoration(_counter, restorationId);
  }
}
```
Repository: PowerToys
Issue: Snap zones like MacOS BetterSnapTool for FancyZones
Labels: Needs-Triage

### Description of the new feature / enhancement

Like in the screenshot I put below, one of the best features of BetterSnapTool on MacOS is being able to define unique zones in the screen where the windows would NOT attach to, but serve as a "shortcut" for a specific window's size.
It acts somehow like the canvas model with overlapping zones, but instead of automatically creating these zones with no visual indication, we would be able to say where to put them.

![Kyler's Studio - Arrange Windows with Snap Areas Better Touch Tool on Mac  8t3E2lB3pcE - 1353x761 - 1m48s](https://user-images.githubusercontent.com/74937642/213935709-b0f679b2-b677-4632-97f8-751050d62407.png)
automatically

### Scenario when this would be used?

This would prevent needing to make 15 models on FancyZones for every size combination I need, which is kind of slow to change. This way we could set a lot of window size combinations and drag them to the correct spot.

### Supporting information

Just like when creating a new model we can choose between 2 types (grid and canvas), and we would be able to select a third option.
Then we would set the size of the window just like when creating a canvas model. Still, instead of needing to drag the windows inside of this zone to trigger the resize, we would also set a shortcut zone anywhere on the screen and when I drag the windows inside that zone, it would resize and move to the correct spot.

[This video](https://www.youtube.com/watch?v=8t3E2lB3pcE) (from where I took the screenshot) shows how it works.
Repository: godot
Issue: move_and_slide() returns vertical motion when running into wall
Labels: bug,topic:physics,topic:2d

### Godot version

3.5.1.stable.official

### System information

Arch Linux, nvidia-open 525.85.05-1,  Asus Proart, RTX A3000 Mobile

### Issue description

KinematicBody2d character gets accelerated downward when walking into a wall on flat ground when (horizontal) ACCELERATION <= 2  (i.e. this ACCELERATION is getting passed to move_and_slide() via move_toward()

### Steps to reproduce

Run the game in the  attached project, make sure the exported  ACCELERATION script variable is set to 2, then run the character into a wall with arrow keys.
Notice the debug output showing that vertical velocity returned by move_and_slide fluctuates and is sometimes larger the the vert velocity (GRAVITY) passed to the function. Consequently, the jump animation and walk animation flicker rapidly.
This does not happen if ACCELERATION >= 3

### Minimal reproduction project

[vert-velocity-bug.zip](https://github.com/godotengine/godot/files/10475311/vert-velocity-bug.zip)
Repository: PowerToys
Issue: powertoys run scaling
Labels: Needs-Triage

### Description of the new feature / enhancement

Add an option to change the scale/size of the run GUI. As of now when you launch it, the search box takes up almost half of my screen length on my 1920x1080 monitor. on my 4k monitor, it is a much more appropriate size. 

while we're here it would also be cool if we can choose where on the screen the run box pops up in addition to the size of the GUI.

### Scenario when this would be used?

Any user that has a smaller resolution display would benefit from being able to scale down/up the GUI to an appropriate size on their monitor. For me, It would be a lot cleaner looking and make it easier to use without it blocking my whole display.

### Supporting information

![Capture](https://user-images.githubusercontent.com/80000135/213943786-e2ecad00-7050-429a-b0c5-6a9538137c50.PNG)
Repository: rust
Issue: TranslateError could have better formatting
Labels: A-diagnostics,T-compiler,A-translation

I'm not sure if this is intentional
````
error: expected expression, found `,`
 --> /home/matthias/vcs/github/glacier2/fixed/94629.rs:2:40
  |
2 |     fn a(){{{{({{{ExprKind::Use {});(]),}}
  |                                        ^ expected expression

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `parse_mismatched_closing_delimiter`:
message was missing
', compiler/rustc_errors/src/emitter.rs:1391:84
stack backtrace:
   0:     0x7f9840cf51e1 - std::backtrace_rs::backtrace::libunwind::trace::hd0b11c0adaab3249
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f9840cf51e1 - std::backtrace_rs::backtrace::trace_unsynchronized::h700e400a91d91fde
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f9840cf51e1 - std::sys_common::backtrace::_print_fmt::hc78435809ad4efce
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f9840cf51e1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha735a792fef532f5
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f9840d6bae8 - core::fmt::write::h4891dd9bd07e2ad5
`````
Looks like we print `` `{stringname}`:\n{message}\n', ...``.
Might be better to just put everything in one line..?

You might need debug assertion to repro these ICEs in the first place.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"ts0yu"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: pytorch
Issue: segfault when running torch.lu_unpack
Labels: module: crash,triaged,module: linear algebra,module: edge cases

### 🐛 Describe the bug

Probably due to negative tensor.


```
import torch
import numpy as np
arg_1_tensor = torch.rand([1, 0, 5, 5], dtype=torch.float64)
arg_1 = arg_1_tensor.clone()
arg_2_tensor = torch.randint(-512,256,[1, 0], dtype=torch.int32)
arg_2 = arg_2_tensor.clone()
arg_3 = True
try:
  res = torch.lu_unpack(arg_1,arg_2,unpack_pivots=arg_3,)
except Exception as e:
  print("Error:"+str(e))
```

### Versions

```
PyTorch version: 1.13.1
Is debug build: False
CUDA used to build PyTorch: 11.6
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.9.15 (main, Nov 24 2022, 14:31:59)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-58-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.6.124
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1660 Ti
Nvidia driver version: 525.78.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==1.13.1
[pip3] torchaudio==0.13.1
[pip3] torchvision==0.14.1
[conda] blas                      1.0                         mkl  
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py39h7f8727e_0  
[conda] mkl_fft                   1.3.1            py39hd3c417c_0  
[conda] mkl_random                1.2.2            py39h51133e4_0  
[conda] numpy                     1.23.5           py39h14f4228_0  
[conda] numpy-base                1.23.5           py39h31eccc5_0  
[conda] pytorch                   1.13.1          py3.9_cuda11.6_cudnn8.3.2_0    pytorch
[conda] pytorch-cuda              11.6                 h867d48c_1    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.13.1               py39_cu116    pytorch
[conda] torchvision               0.14.1               py39_cu116    pytorch

```

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano
Repository: pytorch
Issue: Process get killed when running torch.normal
Labels: triaged,module: numpy

### 🐛 Describe the bug

Process get killed when feeding negative large or even small tensors:

```
import torch
import numpy as np
arg_1_tensor = torch.neg(torch.rand([60000], dtype=torch.float16))
arg_1 = arg_1_tensor.clone()
arg_2_tensor = torch.rand([60000, 1], dtype=torch.float64)
arg_2 = arg_2_tensor.clone()
try:
  res = torch.normal(arg_1,arg_2,)
except Exception as e:
  print("Error:"+str(e))
```

### Versions

```
PyTorch version: 1.13.1
Is debug build: False
CUDA used to build PyTorch: 11.6
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.9.15 (main, Nov 24 2022, 14:31:59)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-58-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.6.124
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1660 Ti
Nvidia driver version: 525.78.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==1.13.1
[pip3] torchaudio==0.13.1
[pip3] torchvision==0.14.1
[conda] blas                      1.0                         mkl  
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py39h7f8727e_0  
[conda] mkl_fft                   1.3.1            py39hd3c417c_0  
[conda] mkl_random                1.2.2            py39h51133e4_0  
[conda] numpy                     1.23.5           py39h14f4228_0  
[conda] numpy-base                1.23.5           py39h31eccc5_0  
[conda] pytorch                   1.13.1          py3.9_cuda11.6_cudnn8.3.2_0    pytorch
[conda] pytorch-cuda              11.6                 h867d48c_1    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.13.1               py39_cu116    pytorch
[conda] torchvision               0.14.1               py39_cu116    pytorch
```

cc @mruberry @rgommers
Repository: rust
Issue: Compiler not suggesting use of `pub use`
Labels: A-diagnostics,T-compiler

### Code

```Rust
// From Rustlings exercise: https://github.com/rust-lang/rustlings/blob/main/exercises/modules/modules2.rs

mod delicious_snacks {
    // TODO: Fix these use statements
    use self::fruits::PEAR as fruit;
    use self::veggies::CUCUMBER as veggie;

    mod fruits {
        pub const PEAR: &'static str = "Pear";
        pub const APPLE: &'static str = "Apple";
    }

    mod veggies {
        pub const CUCUMBER: &'static str = "Cucumber";
        pub const CARROT: &'static str = "Carrot";
    }
}

fn main() {
    println!(
        "favorite snacks: {} and {}",
        delicious_snacks::fruit,
        delicious_snacks::veggie
    );
}
```


### Current output

```Shell
error[E0603]: constant import `fruit` is private
  --> exercises/modules/modules2.rs:26:27
   |
26 |         delicious_snacks::fruit,
   |                           ^^^^^ private constant import
   |
note: the constant import `fruit` is defined here...
  --> exercises/modules/modules2.rs:9:9
   |
9  |     use self::fruits::PEAR as fruit;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...and refers to the constant `PEAR` which is defined here
  --> exercises/modules/modules2.rs:13:9
   |
13 |         pub const PEAR: &'static str = "Pear";
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider importing it directly

error[E0603]: constant import `veggie` is private
  --> exercises/modules/modules2.rs:27:27
   |
27 |         delicious_snacks::veggie
   |                           ^^^^^^ private constant import
   |
note: the constant import `veggie` is defined here...
  --> exercises/modules/modules2.rs:10:9
   |
10 |     use self::veggies::CUCUMBER as veggie;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...and refers to the constant `CUCUMBER` which is defined here
  --> exercises/modules/modules2.rs:18:9
   |
18 |         pub const CUCUMBER: &'static str = "Cucumber";
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider importing it directly
```


### Desired output

```Shell
    use self::fruits::PEAR as fruit;
^^^ consider adding pub
```


### Rationale and extra context

I'm new to Rust and currently aiding my learning with Rustlings.
Just about every time I have an error in my code, the compiler does an excellent job describing where I went wrong.

This time however it seems to be making a strange suggestion to "consider importing it directly" - which to my understanding is not even possible. It would seem more clear/concise to suggest converting the `use` to a `pub use`

`pub use` is new to me as other languages don't have such a concept. There would be no way for me to come to this conclusion on my own.


### Other cases

_No response_

### Anything else?

_No response_