sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Type narrowing in one case statement does not propagate to the next case
Labels: Help Wanted,Possible Improvement

### 🔎 Search Terms

* Type narrowing
* Switch statement

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about switch statements and type narrowing.

### ⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.3.0-beta#code/GYVwdgxgLglg9mABMOcAUBDATgcwFyIDOUWMYOiAPouACYCmwZ9tAlIgN4BQivRA7jCgQAFojQkQ9dtz5zEEDIXqJsFALyaaYBkzAs8Pecagiscfon2WAolnNY0rANxcjxxctW4AdMWxQhADqQiJoAEQAHuGsBAD0cYj09nBYiAAqAMoAjAAcAAwALLkEAORqpYgwhIgADnCEhDAARgA2AJ6IpXSMzLSlPu7GfFj0UCBYSOEAguGuQ3K6GCCtUIbD8qPjk4jhAEJzQwC+XCdAA

### 💻 Code

```ts
function foo(arg: string | undefined) {
    switch (true) {
        case arg === undefined:
            throw new Error();

        case arg.startsWith("x"): // error TS18048: 'arg' is possibly 'undefined'.
            return "A";

        default:
            return "B";
    }
}
```


### 🙁 Actual behavior

`error TS18048: 'arg' is possibly 'undefined'.` in the second case.

### 🙂 Expected behavior

I expect the type to be narrowed to string in the second case statement.

### Additional information about the issue

See also #56352. Ping @Andarist.
Repository: react-native
Issue: [Text component] Missing ellipsis when text contains line breaks (\n) [iOS only]
Labels: Needs: Triage :mag:,Newer Patch Available

### Description

Hi,
I noticed a potential bug which results in missing ellipsis on iOS when limiting lines on the `Text` component if passed text contains line breaks (`\n`).
The text is being truncated properly to the set `numberOfLines` but it's missing the `...` at the end (`ellipsizeMode` set to `tail`).
<img width="326" alt="image" src="https://github.com/facebook/react-native/assets/39768412/643d8274-2938-4229-8e81-2b3739d26033">


### React Native Version

 0.72.6

### Output of `npx react-native info`

Bug reproducible at https://snack.expo.dev/QXsCyRwYN
Expo 49.0

### Steps to reproduce

1. Import React Native `Text` component
2. Use component e.g.
```
<Text numberOfLines={2} ellipsizeMode="tail">
  {text}
</Text>
```
4. Set `text` const as e.g.
```
const text = "Change code \n in the editor and \n watch it change on your phone!"
```
5. Run code on iOS
*The text should contain at least the same number of line breaks (`\n`) as the set limit in the `numberOfLines` prop

### Snack, screenshot, or link to a repository

https://snack.expo.dev/QXsCyRwYN
Repository: three.js
Issue: InstancedMesh: Proposal to support sorting, frustum culling
Labels: Suggestion

### Description

With the current InstancedMesh implementation it's not possible to easily or quickly sort individual instances to improve opaque overdraw for performance or transparency sorting.

Here are a couple posts referring to the transparency sorting issues with InstancedMesh: [ref1](https://discourse.threejs.org/t/transparent-instancedmesh-rendering-bug-with-different-positions/57111), [ref2](https://discourse.threejs.org/t/is-it-possible-to-set-varying-opacity-for-objects-inside-a-instancedmesh-filled-with-boxbuffergeometry-meshpongmaterial-cubes/19181)



### Solution

Similar to how the `WebGL_multi_draw` extension is used for BatchedMesh, there are "instanced" variants of the multidraw functions that allow for sorting the order in which instanced draws are performed while retaining a single draw call. 

If desired we could switch InstancedMesh over to use the multidraw extension, as well, and provide support for sorting objects within a single InstancedMesh. See #27168 (adds sorting objects for BatchedMesh) for a reference on how this might be implemented for InstancedMesh.

The drawbacks are still that `WebGL_multi_draw` is not supported in Firefox so fully switching over to multidraw would remove InstancedMesh support for FF.

### Alternatives

- Add a separate MultiDrawInstancedMesh
- Do nothing 🤷 

### Additional context

cc @WestLangley @donmccurdy
Repository: PowerToys
Issue: PowerToys installation broke default shortcuts
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.75.1

### Installation method

GitHub

### Running as admin

Yes

### Area(s) with issue?

General

### Steps to reproduce

Not sure if it is reproducable, but I can't open IME anymore using win+. shortcut. Also snipping tool shortcut was broken (shift+win+s), but I managed to restore it by reset the app in settings 

### ✔️ Expected Behavior

_No response_

### ❌ Actual Behavior

_No response_

### Other Software

_No response_
Repository: transformers
Issue: cannot recall the model after registering it using AutoModelForCausalLM.register
Labels: New model

### Model description

 I have registered my custom model using AutoModelForCausalLM.register(CustomAIConfig, CustomAI) but I am unable to call the model . It shows ImportError: cannot import name 'CustomAI' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/init.py) . Can you help me in this?

### Open source status

- [ ] The model implementation is available
- [ ] The model weights are available

### Provide useful links for the implementation

_No response_
Repository: rust
Issue: Mark existing well-known cfg as unknown
Labels: T-compiler,C-discussion,F-check-cfg

> There is no way to mark existing well-known attributes as unknown, is there? Specifically, I think it would be nice if there was a way for rustc to raise a warning when it encounters `cfg(test)` (which cargo could then make use of for crates that use `lib.test = false`).

_Originally posted by @jplatte in https://github.com/rust-lang/rust/issues/82450#issuecomment-1802229763_

@rustbot label +C-discussion +F-check-cfg -needs-triage
Repository: godot
Issue: Editor tools not running on v4.2-beta4
Labels: bug,needs testing,topic:dotnet,regression

### Godot version

4.2-beta4

### System information

Windows 10

### Issue description

From the attached script (see steps to reproduce) the redraw does not happen. Since neither the redraw nor the prints happen in v4.2-beta4 but they do happen in v4.1.1, I suppose the _Process method just does not get executed for some reason (it does get executed on v4.1.1 and I get both, the redraw and prints in console).

### Steps to reproduce

1. Empty project
2. Create 2D scene with following script attached
3. Create 2D nodes that you attach to the scene script
4. Assign color in scene script
5. EDIT: Resizing panels like inspector redraws (presumably executing _Process)

Script:
```csharp
[Tool]
public partial class Main : Node2D
{
    [Export] Node2D _nodeA, _nodeB;
    [Export] Color _color;

    private Vector2 PointA => _nodeA.GlobalPosition;
    private Vector2 PointB => _nodeB.GlobalPosition;

    public override void _Process(double delta)
    {
        QueueRedraw();
        GD.Print(PointA, PointB);
    }

    public override void _Draw()
    {
        Rect2 rect = new Rect2(PointA, PointB - PointA);
        this.DrawRect(rect, _color, filled: true, width: -1);
    }
}
```

### Minimal reproduction project

[FourierDrawingsAnim.zip](https://github.com/godotengine/godot/files/13318572/FourierDrawingsAnim.zip)
Repository: next.js
Issue: In standalone mode, `server.js` hardcoded NODE_ENV as production 
Labels: bug,Output (export/standalone)

### Link to the code that reproduces this issue

https://github.com/HugoDerigny/standalone-production-env-bug

### To Reproduce

**From above repo**
1. Run `npm run build`
2. See `server.js` output file
3. Run `node .next/standalone/server.js `
4. See the logs that says it's production environment

**From empty nextjs repo** 
1. Create Next App
5. Configure `next.config.js` `output` to be `standalone`
6. Set `NODE_ENV` as `test` on your computer: `export NODE_ENV=test`
7. Create a `.env.test` file 
8. Run `next build`
-> You will see that the build take envs from `.env.test`.
```
$ next build
   ▲ Next.js 14.0.2
   - Environments: .env.test
``` 

**BUT**

In build files : `.next > standalone > server.js` you can see that NODE_ENV is hardcoded : 
```javascript
/** l.5 */ process.env.NODE_ENV = 'production'
```


### Current vs. Expected behavior

**Current behavior:**
`NODE_ENV` is hardcoded as `production`

**Expected behavior**
`server.js` must not redefine `NODE_ENV` if it's already defined as `test` since it's the only other possible value.

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
Binaries:
  Node: 18.17.1
  npm: 9.6.7
  Yarn: 1.22.19
  pnpm: 7.29.1
Relevant Packages:
  next: 14.0.3-canary.0
  eslint-config-next: 14.0.2
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: standalon
```


### Which area(s) are affected? (Select all that apply)

Standalone mode (output: "standalone")

### Additional context

Even when using `next build` if you `console.log(process.env.NODE_ENV)` in the root layout.tsx, it logs `production` in the build trace.
Repository: rust
Issue: "parallel-rustc" isn't working (on my PC at least)
Labels: A-parallel-queries,WG-compiler-parallel

I tried [the instructions](https://blog.rust-lang.org/2023/11/09/parallel-rustc.html#how-to-use-it) using:

- Windows 10 x64
- i7-4790 CPU @ 3.60GHz, Cores: 4, Logical processors: 8
- nightly-x86_64-pc-windows-msvc - rustc 1.75.0-nightly (0f44eb32f 2023-11-09)
- stable-x86_64-pc-windows-msvc - rustc 1.73.0 (cc66ad468 2023-10-03)

I'm using `config.toml` in `.cargo` dir in the project root:

```toml
[build]
rustflags = ["-Z", "threads=8"]
```

### Results

Dev build
- Without, 2m 45s
- With, 2m 47s

Release build
- Without, 11m 37s
- With, 11m 37s (exactly 37s !)

What am I doing wrong?
Repository: TypeScript
Issue: infinite generator transform is no longer infinite
Labels: Needs Investigation

### 🔎 Search Terms

A function returning 'never' cannot have a reachable end point.

### 🕗 Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about `never` and `generator`.

### ⏯ Playground Link

https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mAVAAggTwgGwKYB4AqAfABQxTYBOAhgEY4BcyAkudXXkQJSMDi2YlKlDgUCAGmQCAbpQngAJtmAwB8wsgDeAKGTIA7gAsYOZMSgUQ2TsjQxsmeSjKD2Abi0BfLVtCRYCFGwADyoAWwAHHDNgqEYAZ3MVAHNuZD4BamFRAFoARmQAH2RciWlKdW1dYBFTCAQE1AMqCmQ4YFQMKIBBCmo0ADpgCjhQ6KCoTkmbOwdG5uQAXiXkACJcFeQAfmQ85EZc9w8gA

### 💻 Code

```ts
function* cycle<T>(iterable: Iterable<T>): Generator<T, never, undefined> {
  while (true) yield* iterable;
}

function* example(text: string): Generator<-1 | 1, never> {
  for (const char of cycle(Array.from(text))) yield char === "<" ? -1 : 1;
}
```


### 🙁 Actual behavior

The second generator function build on top of the first where consumers of `cycle` do not need to check `IteratorResult#done` as the `never` return type is interpreted as never `done`. This is great for direct callers of `cycle()` but other generator functions building on top of `cycle()` are not inferred too as having a return type of `never`.

### 🙂 Expected behavior

A loop over an infinite generator (i.e. one with a return type of `never`) is also inferred as an infinite loop.

### Additional information about the issue

A `throw` statement can be added after the loop as a workaround but I think this shouldn't be necessary:

```ts
function* example(text: string): Generator<-1 | 1, never> {
  for (const char of cycle(Array.from(text))) yield char === "<" ? -1 : 1;
  throw new Error("unreachable");
}
```
Repository: flutter
Issue: Some tests that use iOS simulators get stuck and timeout
Labels: team-infra,P2,triaged-infra

### Is there an existing issue for this?

- [X] I have searched the [existing infra issues](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-infra)

### Type of Request

bug

### Infrastructure Environment

LUCI

### What is happening?

I've only seen in 2 tests so far but seems like sometimes the test/logs gets stuck, you can see the test took 30 minutes but if you look in the log, it only shows a few minutes worth of logs before it cuts off. It's unclear to me if the test got stuck or if the logs stopped being collected or what.

https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20plugin_test_ios/11544/overview
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20plugin_test_ios/11537/overview
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20plugin_test_ios/11541/overview
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20module_test_ios/15507/overview

### Steps to reproduce

_No response_

### Expected results

I expect test to run and logs to show
Repository: node
Issue: HTTP Response doesn't always emit error or finish
Labels: http

The current invariant for Writable streams is that they should always emit either `'error'` or `'finish'`.

However, reviewing the current implementation I don't believe this is the case when the socket closes.

Test case pending.
Repository: terminal
Issue: Paste doesn't always work as expected in broadcasted panes
Labels: Help Wanted,Issue-Bug,Area-UserInterface,Area-TerminalControl,Product-Terminal

<!-- 
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

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!
-->

The pane broadcast functionality that's currently in preview does not describe nor allow to configure how paste functionality works.
Currently, if you paste into a broadcast group of panes using right-click, it only pastes in the pane that the mouse is hovering over.
On the other hand, if you paste using Ctrl-v, it inconsistently pastes into _some_ of the broadcast group panes - but usually not all.


<!-- 
A clear and concise description of what the problem is that the new feature would solve.
Describe why and how a user would use this new functionality (if applicable).
-->

It would be nice if there was a configuration option that specified how to handle paste with a broadcast group.
And, the Ctrl-v paste should be consistent and either configurable or follow the same behavior as right-click.

<!-- 
A clear and concise description of what you want to happen.
-->
Repository: deno
Issue: BYONM: Dynamically importing CommonJS file from an npm package errors
Labels: bug,node compat

```
$ deno run -A npm:create-next-app@latest next-app
$ cd next-app
$ deno run -A --unstable-byonm npm:next dev
error: Uncaught (in promise) ReferenceError: module is not defined
module.exports = nextConfig
^
    at file:///Users/ib/dev/next-app/next.config.js:6:1
```

Chaging `module.exports =` to `export default` fixes the problem.
Repository: vscode
Issue: Gradients on diff view expand sections
Labels: diff-editor,under-discussion

It looks uncharacteristically blurry:

![image](https://github.com/microsoft/vscode/assets/2193314/61a8332e-a35e-4f81-b2de-b961ee7a08b0)
![image](https://github.com/microsoft/vscode/assets/2193314/e3754332-76ed-4b8b-a8e7-fe33a6ec8137)

Proposal:

![image](https://github.com/microsoft/vscode/assets/2193314/0e4fd206-2802-40a4-8724-ca7bc1bdc740)
Repository: vscode
Issue: Let extensions configure the "Start Discussion" for new comments
Labels: feature-request,api,comments

Context: https://github.com/microsoft/vscode/issues/197484#issuecomment-1798636991

We let extensions set the thread label for existing threads, but not for new threads:

![image](https://github.com/microsoft/vscode/assets/38270282/b471f809-1f23-41cf-9b3d-f9ca925d9f54)

We already have `CommentOptions`, which we could add a new `threadLabel` to:
https://github.com/microsoft/vscode/blob/77bc48052be38f30a5c6fc3cb703e306c0a8baef/src/vscode-dts/vscode.d.ts#L16593-L16606
Repository: deno
Issue: Default-true `vendored-dependency` feature for Homebrew and other re-packagers
Labels: build,chore

We should put all of our vendored libraries behind a `vendored-dependency` feature that is turned on by default. If deno is built with --no-default-features, it should build in a mode where dependencies are unvendored (or at least a best-effort).

The `vendored-dependency` feature should consist of multiple sub-features, where we have an option to include a dependency as vendored or not:

 - `vendored-dependency-sqlite`
 - `vendored-dependency-zlib`
 - `vendored-dependency-libffi`
 - `vendored-dependency-brotli`
 - etc...

Downstream re-packaging projects like homebrew and alpine may prefer to have zlib, sqlite and other libraries as system dependencies where possible.

For unvendored dependencies, we may need to add some sanity checks to resource limits/etc (ie: system sqlite may not be sufficient).

We should also have a basic unvendored CI smoke test suite (not necessarily the entire suite) that runs on Linux and Mac.
Repository: opencv
Issue: No mechanism to specify per-architecture CPU_DISPATCH for universal macOS builds
Labels: bug,category: build/install,platform: ios/osx

### System Information

OpenCV 4.x
OS: macOS Sonoma
CMAKE, XCode

### Detailed description

There appears to be no mechanism to set different values for CPU_BASELINE/CPU_DISPATCH CMake variables for universal macOS builds. Universal builds build 2 versions of the code - for x86_64 and for arm processor architectures - and bundle them into the same "fat" library.

We need to have a mechanism to set different values of CPU_BASELINE/CPU_DISPATCH based on the architecture. As an example, I want to have the value of CPU_DISPATCH to be
For arm: NEON
for x86_64: AVX2


### Steps to reproduce

Try to specify different values of CPU_BASELINE/CPU_DISPATCH CMake variables based on the CPU architecture.

Expected behaviour: be able to set different values for CPU_BASELINE/CPU_DISPATCH based on the architecture of CPU: arm or x86_64 when universal macOS build is being configured.

Current behaviour: CPU_BASELINE/CPU_DISPATCH are shared between arm and x86 builds and therefore setting the correct value for ARM will break x86 build and setting the correct value for x86 will break the ARM build. We need to be able to build the universal lib with the right dispatches specified for each architecture.

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)
Repository: PowerToys
Issue: 0.75.1: image resizer not working
Labels: Issue-Bug,Product-Image Resizer,Needs-Triage

### Microsoft PowerToys version

0.75.1

### Installation method

GitHub

### Running as admin

No

### Area(s) with issue?

Image Resizer

### Steps to reproduce

Image resizer doesn't work anymore. I uninstalled 0.75.1, then installed a 0.72.1 and it worked. I choosed 0.72.1 because I had the installer available, don't know about intermediate versions (but I have some 0.74.x and it works).

I tested on two PCs, Windows 10 22H2 with latest windows updates.

I right click on the images (JPG, one or more: same result), choose image resize, nothing happen.
I found three events in log, I attach them

[event 1001 windows error reporting.txt](https://github.com/microsoft/PowerToys/files/13321769/event.1001.windows.error.reporting.txt)
[event 1026 net runtime.txt](https://github.com/microsoft/PowerToys/files/13321770/event.1026.net.runtime.txt)
[event 1000 application.txt](https://github.com/microsoft/PowerToys/files/13321771/event.1000.application.txt)



### ✔️ Expected Behavior

That interface of resizer started.

### ❌ Actual Behavior

It didn't start.

### Other Software

_No response_
Repository: pytorch
Issue: Expose FakeTensor and FakeTensorMode as public APIs
Labels: module: onnx,triaged,module: fakeTensor

### 🚀 The feature, motivation and pitch

Currently, some APIs already support input already fakefied (e.g. `torch.onnx.dynamo_export` and `torch._dynamo.export` as of #105477 #100017 #103865 #106515 #105468). That implies that users had to reference `torch._subclasses.FakeTensorMode` as a private API to fakefy their model/input

Ther UX is a bit awkward due to the mix of private and public API, as shown below:

```python
        class Model(torch.nn.Module):
            def __init__(self) -> None:
                super().__init__()
                self.linear = torch.nn.Linear(2, 2)

            def forward(self, x):
                out = self.linear(x)
                return out

        with torch._subclasses.FakeTensorMode() as fake_mode:
            x = torch.rand(5, 2, 2)
            model = Model()

        # Export the model with fake inputs and parameters
        export_options = ExportOptions(fake_context=fake_mode)
        export_output = torch.onnx.dynamo_export(
            model, x, export_options=export_options
        )
```

On a [PR proposal to fix an issue with model loading for a Hugging Face model](https://github.com/huggingface/safetensors/pull/318#issuecomment-1674517821), they demonstrated concerns in using `FakeTensorMode` in their repo as it is a private API on PyTorch which makes no BC guarantees

The request is to add `FakeTensor` and `FakeTensorMode` to a public namespace such as `torch.export.FakeTensor` and `torch.export.FakeTensorMode` to make the PyTorch API more consistent (if user fake input/model is supported, the Fake tensor API should be available for such) and provide more stability for their party projects to use it

### Additional context

This was [proposed](https://github.com/pytorch/pytorch/pull/106904#pullrequestreview-1573823216) when `torch.export`  was publicly exposed and [Edward](https://github.com/pytorch/pytorch/pull/106904#issuecomment-1674977749) and [Elias](https://github.com/pytorch/pytorch/pull/106904#issuecomment-1675052410) agreed on it

cc @eellison @ezyang
Repository: transformers
Issue: Add Flash Attention 2.0 for T5 Family
Labels: New model,Flash Attention

Encountered the following when trying to incorporate Flash attention into a previously devved byt5-small finetuning script.


Code to produce:

```
from transformers import T5ForConditionalGeneration, AutoTokenizer, Trainer, TrainingArguments, DataCollatorForSeq2Seq

model_path = "google/byt5-small"
model = T5ForConditionalGeneration.from_pretrained(model_path,
                                                   use_flash_attention_2=True,
                                                   )
```


Error:
```
ValueError: The current architecture does not support Flash Attention 2.0. Please open an issue on GitHub to request support for this architecture: https://github.com/huggingface/transformers/issues/new
```