sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Conflicting declaration merging doesn't fail in .d.ts files
Labels: Bug,Help Wanted

# Bug Report

### 🔎 Search Terms

declaration merging

### 🕗 Version & Regression Information

**This is the behavior in every version I tried, and I reviewed the FAQ for entries about `declaration merging`**

(NOTE: I only tried this on TS 4.5.4 because I couldn't reproduce the issue in the bug workbench; see below.)

### ⏯ Playground Link

[Repro here](https://github.com/thw0rted/issue-examples/tree/declaration-merge-conflict).  I tried to reproduce the error in bug-workbench but the error is flagged correctly there. (Although, I did discover https://github.com/microsoft/TypeScript-Website/issues/2198 in the process...)

### 💻 Code

```ts
//@filename: second.d.ts
export {}

declare global {
    interface Foo {
        x: number;
    }
}


// @filename: first.d.ts
export {}

declare global {
    interface Foo {
        x: string;
    }
}





// @filename: index.ts
import "second";
import "first";

declare const f: Foo;

f.x = "";
f.x = 2;
```

### 🙁 Actual behavior

Running `tsc` on the repro does not flag the conflicting interfaces as an error.  One interface is chosen over the other depending on which one reaches the typechecker first.  (Check out the repro and change the order of the `import` statements to see what I mean.)

### 🙂 Expected behavior

The compiler should flag the second imported interface declaration as invalid and refuse to emit, rather than silently ignoring one of the declarations.

Alternately, if this is correct behavior, it should be explained in [the relevant section of the Handbook](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces), which currently says

> Non-function members of the interfaces should be unique. If they are not unique, they must be of the same type. The compiler will issue an error if the interfaces both declare a non-function member of the same name, but of different types.
Repository: pytorch
Issue: [FX] Detect attribute mutation during tracing
Labels: triaged,module: fx

### 🚀 The feature, motivation and pitch

Set-up: a `Module` that mutates one of its own attributes during `forward`:

```
import torch
import torch.fx

class Foo(torch.nn.Module):
  def __init__(self):
    super().__init__()
    self.attr = 4

  def forward(self, x):
    self.attr += 1
    return x + self.attr

mod = Foo()
out = mod(torch.ones(5, 3))
torch.testing.assert_allclose(out, torch.ones(5, 3) + 5)

out = mod(torch.ones(5, 3))
torch.testing.assert_allclose(out, torch.ones(5, 3) + 6)
```

This breaks during symbolic tracing:

```
traced = torch.fx.symbolic_trace(Foo())

print(traced.code)
"""
def forward(self, x):
    add = x + 5;  x = None
    return add
"""

out = traced(torch.ones(5, 3))
# NB: tracing already incremented `self.attr` once, so we expect the next
# invocation to have a value of 6 before adding to the tensor
torch.testing.assert_allclose(out, torch.ones(5, 3) + 6)
"""
AssertionError: Tensor-likes are not close!

Mismatched elements: 15 / 15 (100.0%)
Greatest absolute difference: 1.0 at index (0, 0) (up to 1e-05 allowed)
Greatest relative difference: 0.14285714285714285 at index (0, 0) (up to 0.0001 allowed)
"""
```

There are a couple issues of interest here:

1) The mutation occurs during symbolic tracing, which may be unexpected
2) The results of this mutation are baked in at trace time. Concretely, in the example, the constant `6` is baked into the trace and the mutating behavior is lost for further invocations of the traced module.

It is not likely that we want to model such mutations (especially on Python scalar values), so we should figure out if we can detect this mutation and throw an error at trace time. For example, we can see if we can make the `Tracer.check_mutable_operations` flow detect this:

```
tracer = torch.fx.Tracer()
tracer.check_mutable_operations = True

mod = Foo()
traced_graph = tracer.trace(mod)
traced = torch.fx.GraphModule(mod, traced_graph)
print(traced.code)
"""
def forward(self, x):
    add = x + 5;  x = None
    return add
"""

out = traced(torch.ones(5, 3))
torch.testing.assert_allclose(out, torch.ones(5, 3) + 6)
"""
AssertionError: Tensor-likes are not close!

Mismatched elements: 15 / 15 (100.0%)
Greatest absolute difference: 1.0 at index (0, 0) (up to 1e-05 allowed)
Greatest relative difference: 0.14285714285714285 at index (0, 0) (up to 0.0001 allowed)
"""
```

A possible implementation of this might involve patching `setattr` on `nn.Module` during tracing and throwing an error in that implementation

### Alternatives

_No response_

### Additional context

_No response_

cc @ezyang @SherlockNoMad
Repository: pytorch
Issue: torch.jit.optimized_execution is not mentioned anywhere in the docs
Labels: oncall: jit,Stale

### 📚 The doc issue

If you try to search for `torch.jit.optimized_execution` in the PyTorch docs, you will find 0 results:
https://pytorch.org/docs/stable/search.html?q=optimized_execution&check_keywords=yes&area=default

However, it appears like this function is meant for public use despite there being no mentioned of it outside user comments on different sites.

https://github.com/pytorch/pytorch/search?q=torch.jit.optimized_execution

### Suggest a potential alternative/fix

The `torch.jit.optimized_execution` function should be properly documented, and probably linked to TorchScript / JIT page: https://pytorch.org/docs/stable/jit.html
Repository: TypeScript
Issue: Unable to use Symbol as key for jsdoc `@typedef`
Labels: Bug,Help Wanted

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

jsdoc ts2454

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about `2454`

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?strictNullChecks=true&ts=4.5.4&filetype=js#code/MYGwhgzhAEBiD29oG8CwAoAkBeBbApgAoBO8ADtALzQBEAbmCAK740DcGAvhhsPAHYQALtAgBPXFWgBlCQCN4IABQ1xuGgEoO6APQAqPdAACQsWXwATfADMUCJADIU0ANpqAugH4AXKKHEAS34Ac2hOTjhEAHUAoQALWUk9HQwdHWgMzKzsnIA9fIBaIqLoADUwQLA5EHxoAHI1OugAmCYIS2g5G3hiWq6g0MgIAOD+DqUAJgAWAFYpjSA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```js
class Foo {
    someProp = "value";
}

const sym = Symbol("sym");
/** @typedef {Foo & { [sym]?: string }} FooWithSym */
//                     ^^^----- Variable 'sym' is used before being assigned (2454)
```

Note that this error only happens with `strictNullChecks` enabled.

### 🙁 Actual behavior

ts2454

### 🙂 Expected behavior

No errors

When using TypeScript rather than JavaScript, this error does not occur.

Here is the TypeScript equivalent: ([playground](https://www.typescriptlang.org/play?#code/PTAEDkHsCcFsEMA2iCeoAuALAlgZ1AO6QCuiAJqAEYCmo8AdqNrAA4zrUUDGi8uuAWABQPPvgBikSKADewgJC5IsagAVokFqAC8oAEQA3JMWp6A3MIC+w4SDpkKWWrhSxKkRBhQta6aZMhhLkh6XHRQF1gdUABlV3dEAAo9SL0ASgshdG9aAIB1bCw4qN0A0AAyWQUAbUiAXQB+AC4I9GhsegBzTOshIJCwwkLMEnRi6PpqAlAAxIzhAmHR4trXOui9DjDzUDtqaA1oABo6fGoADx8uDjIbPpEB8MWi11AW-OHx3Unp2fmhZ6YFb1DZbdA7OxYPCEGAAa0E92CoXCaF0gOBa0ySKUiGoADpEJBOokUBldmA0NCAAZhdpdUAAH1AxHoZGoADMOpwqcIgA))

```ts
// Normally this would be an imported class
class Foo {
    someProp = "value";
}

// add the symbol type to Foo
const sym = Symbol("sym");
type FooWithSym = Foo & {
    [sym]?: string;
}

const withoutSym = new Foo();
withoutSym[sym] = "test"; // error, as expected


const withSym : FooWithSym = new Foo();
withSym[sym] = "test"; // this works

const y = withSym[sym];
console.log(y); // y is `string | undefined`
```
Repository: pytorch
Issue: Building docs locally fails
Labels: module: docs,triaged

### 🐛 Describe the bug

Running documentation build with `make html` as described [here](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md#building-documentation) results in failure: `Makefile:38: recipe for target 'html' failed`. 

The full build log (`make html 2>&1 | tee build.log`) is available [here](https://pastebin.com/SGx3Em3z).

It looks like the overall failure is caused by multiple exceptions of autodoc trying to import symbols from `torch.distributed.*`.

The failure is observed in both master (b7b32b56f129b70782eb3acf02a966605f5b1209) and viable/strict (795af1578ccade97792646e02e5ec3c295385501)



### Versions

PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CMake version: version 3.22.0

Python version: 3.8 (64-bit runtime)
Is CUDA available: N/A
CUDA runtime version: 10.2.89
GPU models and configuration: GPU 0: GeForce RTX 2080 Ti
Nvidia driver version: 460.91.03
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.21.4
[pip3] pytorch-sphinx-theme==0.0.24
[pip3] torch==1.11.0a0+gitb7b32b5
[pip3] torchvision==0.11.1
[conda] Could not collect


cc @brianjo @mruberry
Repository: pytorch
Issue: Make it possible to remove all hooks on a specified module without needing the hook handles
Labels: module: nn,triaged,enhancement,Stale

### 🚀 The feature, motivation and pitch

Some scenarios makes keep track of the hook handles rather difficult if not impossible. There should be a way to remove all active hooks on a module without using the handles.


Using the following function, one can see the open and active hooks on a the target module (ex: model layer):

```
def find_hooks(m: torch.nn.Module):
    print("Hooks")
    c = 0
    module_name = type(m).__name__
    print(m._forward_hooks)
    for k, v in m._forward_hooks.items():
        c+=1

    print("All " + str(c) + " hooks found")
```


Ideally one should be able to use the loop above to remove the hooks, or a simple callable class function could be used like:

```
 module._forward_hooks.remove()
```

### Alternatives

_No response_

### Additional context

This issue is preventing the usage of TorchScript / JIT on models using our optimization abstraction, and there does not appear to be an easy fix. It's also resulting in a ton of 'ghost' hooks that are never used.


The code for `register_module_forward_hook` appears to use global variables, which should make it possible to remove them with the handle: https://pytorch.org/docs/stable/_modules/torch/nn/modules/module.html#register_module_forward_hook


The relevant hook code seems be found at these locations:

https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/module.py
https://github.com/pytorch/pytorch/blob/master/torch/utils/hooks.py


cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345
Repository: opencv
Issue: OpenCV 4.5.5: No module named cv2 - wrong Python 3 install path on Raspberry Pi OS Bullseye
Labels: bug,category: python bindings,category: build/install,platform: linux

##### System information (version)

- OpenCV => 4.5.5
- Operating System / Platform => Raspberry Pi OS Bullseye (32-bit)
- Compiler => gcc 10.2.1

##### Detailed description

On Raspberry Pi OS Bullseye (32-bit), OpenCV 4.5.5 Python 3 packages are installed to `lib/python3.9/site-packages/cv2/python-3.9` instead of `lib/python3.9/dist-packages/cv2/python-3.9`. Issue happened since OpenCV 4.5.5. OpenCV 4.5.4 Python 3 packages was found successfully because installation directory is `lib/python3.9/dist-packages/cv2/python-3.9`.

I think issue related with https://github.com/opencv/opencv/commit/d6891c705e269465222049510ef0920a47507ca9#diff-d55511776794dc61d4962ae7a9025c0fa54a10b3db01de0079c6ad031f259851R180 (#21219)

Other Debian-based Linux distributions might be affected as well.

##### Steps to reproduce

`python3 -c "from sysconfig import *; print(get_path('purelib'))"`

Output: `/usr/lib/python3.8/site-packages`
Repository: rust
Issue: Test output capture does not capture Command output
Labels: T-compiler,A-libtest,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
#[test]
fn foo() {
    println!("hello");
    std::process::Command::new("echo").arg("world").status().unwrap();
}
```

I expected to see this happen: nothing should be printed to STDOUT for `cargo test`, while "hello" and "world" should be printed to STDOUT with `cargo test -- --nocapture`.

Instead, this happened: "world" is always printed to STDOUT ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1c5ed14361b2c7a8763f01156bb0a8af)).

### Meta

`rustc --version --verbose`:
```
rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-apple-darwin
release: 1.57.0
LLVM version: 13.0.0
```

The issue also occurs on nightly.

### Notes

This happens because the output capture hook used by libtest only affects things that go through `print_to`:

https://github.com/rust-lang/rust/blob/442248d6bcc00693922941eb5a9f241e0e9da2c0/library/std/src/io/stdio.rs#L1167

It's already known that libtest output capturing has some... inconsistencies (e.g., https://github.com/rust-lang/rust/issues/12309, https://github.com/rust-lang/rust/issues/90785, https://github.com/rust-lang/rust/issues/35136), but in this _particular_ case I wonder if it's possible to do something about it since `std` controls the defaults for `Command`. Specifically, it might make sense to have `Command` default to a capturing `.stdout` and `.stderr` when those aren't overwritten in the builder.
Repository: tauri
Issue: [feat] Support macOS `isDocumentEdited`
Labels: type: feature request,status: upstream

### Describe the problem

macOS has an indicator for unsaved documents. Would be nice for Tauri to support it

When `isDocumentEdited` is true, it shows a dot indicator like this:
<img width="78" alt="Screenshot 2021-12-29 at 12 39 57 AM" src="https://user-images.githubusercontent.com/11315492/147614983-3f009c23-3303-4e13-8a2c-72accc7fbc21.png">

### Describe the solution you'd like

`win.set_is_document_edited(bool)`
`win.is_document_edited() -> bool`

### Alternatives considered

_No response_

### Additional context

isDocumentEdited: https://developer.apple.com/documentation/appkit/nswindow/1419311-isdocumentedited
Repository: godot
Issue: Const expressions of equal value and type are shared 
Labels: bug,topic:gdscript,confirmed,regression

### Godot version

4.0.dev (28174d531)

### System information

5.15.2-2-MANJARO

### Issue description

I couldn't find any open issue about this behavior of `const`. `const` initializer expressions that reduce to the same type and same (`==`) value are shared, as an optimization I assume. But this can lead to unexpected situations.

According to the docs, `const` arrays are intended to be mutable. This is fine by itself, but with the sharing behavior, it is chaos:
```gdscript
const arr1 = []
const arr2 = []
func _ready():
    arr1.append(1)
    print(arr1)
    print(arr2)
```
Output:
```
[1]
[1]
```
Note: This is not only for empty arrays.

I believe another issue, brought up by @aaronfranke on rocket chat, is caused by the same behavior:
```gdscript
print(0.0)
print(-0.0)
```
```
0.0
0.0
```
and:
```gdscript
print(-0.0)
print(0.0)
```
```
-0.0
-0.0
```

### Steps to reproduce

Just run the code blocks in "Issue description".

### Minimal reproduction project

_No response_
Repository: rust
Issue: Funky rustdoc behavior when `pub use path_to::Trait as _;` for public-in-private item
Labels: T-rustdoc,C-bug,A-rustdoc-ui

Something like
````rs
mod m {
    pub trait Hello {
        fn hello() {}
    }
    pub trait World {
        fn world() {}
    }
}

pub use m::Hello as _;
pub use m::World as _;
````
creates documentation listing two traits called "`_`"

![Screenshot_325](https://user-images.githubusercontent.com/3986214/147618149-ef5a0529-c52e-44de-8e71-c6aef18e4391.png)

both of which link to *the same* URL `.../target/doc/crate_name/trait._.html` and which contains documentation for one of the two traits, chosen seemingly at random.

When I add a few implementations, sometimes (not very reproducably) I've even gotten a weirdly broken page. E.g. I sometimes get
````rs
mod m {
    pub trait Hello {
        fn hello() {}
    }

    pub trait World {
        fn world() {}
    }

    impl World for u8 {
        fn world() {}
    }

    impl World for u16 {
        fn world() {}
    }

    impl World for u32 {
        fn world() {}
    }
}

pub use m::Hello as _;
pub use m::World as _;
````
to generate a page that looks like this

![Screenshot_326](https://user-images.githubusercontent.com/3986214/147618429-f888264d-0039-43c3-b4f0-19ed1eba4f24.png)

@rustbot label T-rustdoc, A-rustdoc-ui

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

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

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: flutter
Issue: `suffixIcon/prefixIcon` alignment in an growing multiline TextField
Labels: a: text input,framework,f: material design,d: api docs,d: examples,team-design,triaged-design


## Use case

I'd like to add prefix/suffix icons which are vertically aligned to the top or bottom of a multiline TextField. The TextField might have a fixed height `TextField(maxlines: 4)` or an auto-growing height with a limit: `TextField(maxlines: 4, minlines: 1)`. Think about a Telegram chat input box.

This feature has been requested in https://github.com/flutter/flutter/issues/42651 with ideal example images:

![](https://user-images.githubusercontent.com/1025241/94514883-f8252d00-022a-11eb-9d04-bfe5b7d13142.png)


![](https://user-images.githubusercontent.com/30778803/109836081-e110be00-7c54-11eb-985d-879da364133d.png)

And it has been closed by https://github.com/flutter/flutter/pull/91998 which add some doc how to do it. However, the PR doesn't work:

- The code snippet only covers simple one-line TextField situation.
- The technique given in the comment https://github.com/flutter/flutter/pull/91998#issue-1029071224 results in wrong paddings and alignments:

<img width="310" alt="Screen Shot 2021-12-29 at 10 48 17 AM" src="https://user-images.githubusercontent.com/45989292/147622752-c0d27a99-ecce-4940-82c9-d28d143f69a7.png">

- I'm wondering if using `Align` with `heightFactor` in this multiline situation is just no possible, considering icon and text have different sizes.


## Proposal

I need a way to do this correctly.
Repository: flutter
Issue: [Windows Web] Telex IME causes crashes
Labels: a: text input,framework,a: internationalization,platform-windows,platform-web,a: desktop,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-framework,triaged-framework

I created the sample and reproduced this issue. If I use telex to type, it will throw this exception.
I think that it related to the unicode in the textfield

https://user-images.githubusercontent.com/4393681/147629539-8bab359a-5cb5-4fb0-a999-8fa02157cd15.mp4

d
Repository: pytorch
Issue: Fusion of Convolution and BatchNorm
Labels: module: cudnn,feature,triaged

### 🚀 The feature, motivation and pitch

Is there an operator that fuse conv and BN during training？Such as 
https://docs.nvidia.com/deeplearning/cudnn/developer-guide/index.html#op-fusion
or

https://docs.nvidia.com/deeplearning/cudnn/api/index.html#cudnnFusedOps_t


### Alternatives

_No response_

### Additional context

_No response_

cc @csarofeen @ptrblck @xwang233
Repository: flutter
Issue:  Use SingleChildScrollView to nest SelectableText, long press to select all at the front of the text, the copy option is displayed at the bottom but cannot be clicked
Labels: a: text input,framework,f: material design,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-design,triaged-design

Use SingleChildScrollView to nest SelectableText, long press to select all at the front of the text, the copy option is displayed at the bottom but cannot be clicked.

### video

https://user-images.githubusercontent.com/26619749/147636232-53dec59a-643c-4301-89f0-77ecd48eff04.mp4



### This is a reproducible code：

@override
  Widget build(BuildContext context) {

    return Scaffold(
      body: SingleChildScrollView(
        child: Column(
          children: [
            SizedBox(
              height: 100,
            ),
            SelectableText(
              "Flutter " * 600,
            ),
            SizedBox(height: 100,)
          ],
        ),
      ),
    );
  }

### flutter doctor

[✓] Flutter (Channel stable, 2.8.0, on macOS 11.2.1 20D74 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc4)
[!] Xcode - develop for iOS and macOS (Xcode 12.5.1)
    ! Flutter recommends a minimum Xcode version of 13.0.0.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] IntelliJ IDEA Community Edition (version 2021.2)
[✓] VS Code (version 1.63.2)
[✓] Connected device (3 available)
Repository: flutter
Issue: [Android][TouchEvent][Joggle] Touch Cancel Event with location window
Labels: platform-android,engine,P2,team-android,triaged-android

## Steps to Reproduce
In Android Flutter App with none full screen Activity，**TouchCancel** Event with [getY](https://github.com/flutter/engine/blob/main/shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java#L233) location will added with status bar height, and in [packet converter ](https://github.com/flutter/engine/blob/main/lib/ui/window/pointer_data_packet_converter.cc#L100) will add a synthesized move event.

Finally it will case the last two event‘s **Y distance** larger than others, and case scrollable view joggle.

screenshot with touch event, the last  cancel event's Y add with location 136.

![image](https://user-images.githubusercontent.com/1678324/147637360-43926241-90cb-43a9-877a-7d6d066b0430.png)

go back current activity, scroll view will case joggle effect

https://user-images.githubusercontent.com/1678324/147637796-105f14ab-9ba5-462d-9ad8-feacad87b4e8.mp4

## Solution
we should minus flutter view‘s window location in TouchEvent Cancel

![image](https://user-images.githubusercontent.com/1678324/147637905-531d6e8b-3b6c-4737-af01-383df6db81ad.png)