sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Nullish coalescing should always include the type of the right operand
Labels: Suggestion,In Discussion

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
```
$ ./node_modules/.bin/tsc --version
Version 3.7.2
```

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Code**

A toy example would be something like this.
```ts
let foo: string = "";
foo = "bar" ?? 123;
```
This one is obviously fine since `"bar"` is always truthy.

However, this becomes a little bit problematic when you consider the idiom of having `Record` objects and checking their truthiness before using them.
```ts
const elts = ["foo", "bar", "spam", "spam", "foo", "eggs"];
const counts: Record<string, number>;
for (const elt of elts) {
  // This really **should** raise an error.
  counts[elt] = counts[elt] ?? "zero";
  counts[elt] += 1;
}
```

**Expected behavior:**
An error should be raised.

**Actual behavior:**
Curiously, an error is **not** raised in strict mode but **is** raised in un-strict mode.

```sh
$ ./node_modules/.bin/tsc ./foo.ts 
foo.ts:5:3 - error TS2322: Type 'number | "zero"' is not assignable to type 'number'.
  Type '"zero"' is not assignable to type 'number'.

5   counts[elt] = counts[elt] ?? "zero";
    ~~~~~~~~~~~


Found 1 error.
```

```sh
$ ./node_modules/.bin/tsc --strict ./foo.ts
# No error, exits 0 and emits JS.
```
**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
[Playground Link](http://www.typescriptlang.org/play/?strictNullChecks=false&ts=3.8.0-dev.20200122#)

Toggling the `strictNullChecks` config option will show the issue.

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
Repository: go
Issue: cmd/link: trailing padding after "Go" in ELF note name
Labels: help wanted,NeedsFix,compiler/runtime

https://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section says [emphasis added]:

> namesz and name  
> The first namesz bytes in name contain a null-terminated character representation of the entry's owner or originator. There is no formal mechanism for avoiding name conflicts. By convention, vendors use their own name, such as XYZ Computer Company, as the identifier. If no name is present, namesz contains 0. Padding is present, if necessary, to ensure 8 or 4-byte alignment for the descriptor (depending on whether the file is a 64-bit or 32-bit object). **Such padding is not included in namesz.**

It looks like we get this right for the "NetBSD" tag, where we include a single nul-terminator character within the name (as measured by namesz), but then include an extra padding zero-byte for alignment.

However, for the "Go" tag, we include an extra nul-terminator within the name itself. The second nul-terminator should actually be padding.

Pointed out by Mark Kettenis from OpenBSD.

/cc @4a6f656c
Repository: pytorch
Issue: [feature request] Out-variant and dtype argument for torch.argmax / torch.argmin / torch.argsort (and friends)
Labels: module: memory usage,triaged,module: sorting and selection,function request,module: reductions

It could save a lot of memory when relevant axis is very thin (e.g. 2 or 3 element-sized axis), and the result is known to fit in a byte (x8 memory save)

cc @heitorschueroff
Repository: go
Issue: os: document the Process.Pid field
Labels: Documentation,help wanted,NeedsFix

As discussed in https://groups.google.com/forum/#!topic/golang-nuts/ievQGPz1R7k, https://golang.org/cl/4029053 dropped the documentation for the `Pid` field.

I also propose to extend the documentation with something like:
```
The value of Pid after the process has been waited/released is not specified.
```
The reason is that on *UNIX* systems, `Release` set `Pid` to -1, but not on *Windows*.
This means that a program can not check if `Pid` == -1 to determine if the process has been released.

The alternative is to change the *Windows* implementation.
Repository: pytorch
Issue: Interrupting a DDP worker while using the CUDA MPS server causes CUDA to hang until reboot
Labels: oncall: distributed,module: cuda,triaged

## 🐛 Bug
When using the CUDA MPS server, having a DataDistributedParallel worker fail can cause CUDA to hang permanently on the machine until it's rebooted.

I think this is more an NVIDIA bug than a PyTorch bug and I've submitted it to them, but it's something that other PyTorch users are likely to run in to too, so I'm reporting it here.

## To Reproduce
I have a minimal example [here](https://gist.github.com/andyljones/8886f903d9ae82b108992dc47978ef20).

## Expected behavior
The expected behaviour is that future CUDA launches in separate processes should not hang.

## Environment
```
PyTorch version: 1.4.0
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: Could not collect

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.1.243
GPU models and configuration: 
GPU 0: GeForce RTX 2080 Ti
GPU 1: GeForce RTX 2080 Ti

Nvidia driver version: 440.26
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.4.0
[pip] torchfile==0.1.0
[pip] torchvision==0.5.0
[conda] blas                      1.0                         mkl  
[conda] mkl                       2019.4                      243  
[conda] mkl-service               2.3.0            py37he904b0f_0  
[conda] mkl_fft                   1.0.15           py37ha843d7b_0  
[conda] mkl_random                1.1.0            py37hd6b4f25_0  
[conda] pytorch                   1.4.0           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch
[conda] torchfile                 0.1.0                    pypi_0    pypi
[conda] torchvision               0.5.0                py37_cu101    pytorch
```

## Additional context
The bug ID on NVIDIA's side is `2750018`. 

cc @ngimel @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @xush6528 @osalpekar
Repository: svelte
Issue: CSS isolation bug when components styles is equals and have not used css rule
Labels: bug,temp-stale

I think it is optimization side effect.
Likely it can be reproduced only if you have at least one not used css rule.
[See this repl](https://svelte.dev/repl/ddc97886a98741dbbb40e58607aaa265?version=3.17.3)

**See these components:**

Component1.svelte
```svelte
<div class="red"> Red </div>

<style>
	.red {
		background: red;
	}
	.yellow {
		background: yellow;
	}
</style>
```

Component2.svelte
```svelte
<div class="red"> Red </div>
<div class="yellow"> Yellow </div>

<style>
	.red {
		background: red;
	}
	.yellow {
		background: yellow;
	}
</style>
```

**1.** For these components svelte generates different CSS with same css class suffixes

Component1.css
```css
.red.svelte-1q75qj7{
    background:red
}
```

Component2.css
```css
.red.svelte-1q75qj7 {
    background:red
}
.red.svelte-1q75qj7{
    background:red
}
.yellow.svelte-1q75qj7{
    background:yellow
}
```

**2.** Depending on which component loads first, only one of these styles will be loaded. You can see in the repl that Yellow div is not yellow.
Switch the tabIndex default value to 2, and this div will be yellow.

App.svelte
```svelte
<script>
	import Component1 from './Component1.svelte'
	import Component2 from './Component2.svelte'
	
	let tabIndex = 1
</script>

<button on:click={() => tabIndex = 1}>Tab 1</button>
<button on:click={() => tabIndex = 2}>Tab 2</button>

{#if tabIndex === 1}
	<Component1 />
{:else}
	<Component2 />
{/if}
```

**3.** Even if both styles will be loaded, their loading order will affect the style of the component. Thus, the styles of some components will affect others.
Repository: opencv
Issue: OPENCV-DNN Using new cfg from Darknet repository causes error
Labels: feature,category: dnn

OpenCV 4.2.0

New models from Alexey Darknet repository

CFG:  https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/csresnext50-panet-spp-original-optimal.cfg

WEIGHTS: https://drive.google.com/open?id=1_NnfVgj0EDtb_WLNoXV8Mo7WKgwdYZCc

Testing with the new OPENCV-dnn with cuda support I achieve better performance than using Darknet library (even 2x FPS on a 1060 GTX), but the problem is that this model (which is quite better than the standard yolov3.cfg) causes this error.

**opencv/modules/dnn/src/dnn.cpp:1428:
error: (-204:Requested object was not found) Layer with requested id=-1 not found in function 'getLayerData'**
Repository: pytorch
Issue: Document different gradient wrt to jax when nesting
Labels: module: docs,module: autograd,triaged

## 🐛 Bug

The following code results in `0` when the expected answer is `-1`:

```python
def f1(x):
    def f2(y):
        return y*(x-y)
    return torch.autograd.grad(f2(x), x, create_graph=True)[0]

x = torch.tensor(1.0, requires_grad=True)
torch.autograd.grad(f1(x), x)[0]
```

## To Reproduce

Run the code above.

## Expected behavior

The code should result in `tensor(-1.)` rather than `tensor(0.)`.

## Environment

```
PyTorch version: 1.4.0
Is debug build: No
CUDA used to build PyTorch: None

OS: Mac OSX 10.15.1
GCC version: Could not collect
CMake version: version 3.15.5

Python version: 3.7
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip3] numpy==1.16.3
[pip3] torch==1.4.0
[pip3] torchvision==0.5.0
[conda] blas                      1.0                         mkl  
[conda] mkl                       2019.3                      199  
[conda] mkl_fft                   1.0.12           py37h5e564d8_0  
[conda] mkl_random                1.0.2            py37h27c97d8_0  
[conda] pytorch                   1.4.0                   py3.7_0    pytorch
[conda] torchvision               0.5.0                  py37_cpu    pytorch
```

## Additional context

The following code in JAX produces the expected behaviour, for comparison:

```python
def f1(x):
    def f2(y):
        return y*(x-y)
    return jax.jvp(f2, (x,), (1.0,))[1]

jax.jvp(f1, (1.0,), (1.0,))[1] # => DeviceArray(-1., dtype=float32)
```


cc @ezyang @SsnL @albanD @zou3519 @gqchen
Repository: flutter
Issue: Test if a new iOS build exists before uninstalling the old version
Labels: platform-ios,tool,c: proposal,P3,team-ios,triaged-ios

## Use case
I recently tried to reinstall a Flutter app to an iOS device that I hadn't redeployed to in a few weeks.

```
$ flutter install
Installing come.example.my_app to My iPad...
Uninstalling old version...
Could not find application bundle at build/ios/iphoneos/Runner.app; have you run "flutter build ios"?
Install failed
```

At this point, I've received good guidance on what to do next, and when I attempted to do so, I had another failure which took me a little longer to resolve - I had an expired signing certificate, so it took me a few minutes to figure that out and resolve.

However I've already uninstalled the old version from the iPad, and lost the ability to use the older version - which might have been a more extensive fix, but I was lucky here.

## Proposal
I propose to perform the test to see if there's a new bundle before removing the existing one.

This test could be moved to be performed before removing the existing version:
https://github.com/flutter/flutter/blob/92cbaa3efe985cc8370d0d70fef5058c971b2eee/packages/flutter_tools/lib/src/ios/devices.dart#L225-L229

I'm not sure to where or how, but maybe some test in this function would be the right place?
https://github.com/flutter/flutter/blob/ec2d58335a1b4273ddc0f855bd3666d8bc0b09b6/packages/flutter_tools/lib/src/commands/install.dart#L57-L58

I might be way off - it's entirely possible there was an existing build in the build/ directory, and the error message was incorrect - but since I don't have the prior state of an expired provisioning certificate, I'm going of what I saw in the CLI response.
Repository: godot
Issue: RigidBody2D rotates on collision in 3.2, works fine in 3.1
Labels: discussion,topic:physics

**Godot version:**
3.1.2

**OS/device including version:**
Windows 7

**Issue description:**
When opening a 3.1.2 project on any of the version of godot 3.2 it rotates when collison happens. In 3.1.2 it doesn't rotates only moves.

**Steps to reproduce:**
Just make any project where rigidbody collides with something in 3.1.2 and then open it in 3.2.

**Minimal reproduction project:**
Repository: TypeScript
Issue: Type cast should try to remove readonly modifier
Labels: Suggestion,Awaiting More Feedback

The compiler should try to use mutable versions of readonly tuples when couldn't cast readonly tuples to mutable arrays mainly for usability of `as const`. The performance impact of this would be a little because the condition when this check runs is limited.

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  3.7.x-dev.20200123

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Code**

```ts
([0] as [0]) as number[];
([0] as [0]) as readonly number[];
// As the expansion of [0] as const
([0] as readonly [0]) as number[]; // error
([0] as readonly [0]) as readonly number[];
```

**Expected behavior:**
pass
**Actual behavior:**
```
Conversion of type 'readonly [0]' to type 'number[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  The type 'readonly [0]' is 'readonly' and cannot be assigned to the mutable type 'number[]'.(2352)
```
**Playground Link:** http://www.typescriptlang.org/play/index.html?target=99&ts=3.8.0-dev.20200123&ssl=1&ssc=1&pln=6&pc=1#code/BQbQDAugBAhgzlcECUsEDsCuBbARgUwCcQIBuAKFEjUUlXikPxgBMB7dAGwE8os8iJCgHphUAIIIALgAt8UfAA8ADjHRwAlhyhsAZrWgMAxhzhTKSGk1YceB+hhwFiZKKIWFCbQheoNr7Fy8SA6MzIF2-M5C5EA

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
Repository: pytorch
Issue: SGD optimizer with deprecation warning
Labels: module: optimizer,triaged,module: deprecation

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

When using SGD optimizer, I got the deprecation warning. The reason behind this is related to `add_` function in SGD. Should be an easy fix.

## To Reproduce

Steps to reproduce the behavior:

1. Use the following code snippet

```
import torch
model = torch.nn.Linear(2, 3)
optimizer = torch.optim.SGD(model.parameters(), lr=5)
t1 = torch.Tensor([[1.0, 2.0], [3.0, 4.0]])
output_t = model(t1)
criterion = torch.nn.CrossEntropyLoss()
loss = criterion(output_t, torch.Tensor([1, 2]).long())
loss.backward()
optimizer.step()
```
## Expected behavior

```
../torch/csrc/autograd/generated/python_variable_methods.cpp:1334: UserWarning: This overload of add_ is deprecated:
add_(Number alpha, Tensor other)
Consider using one of the following signatures instead:
add_(Tensor other, Number alpha)
```
## Environment

PyTorch version: 1.5.0a0+a5161c7
Is debug build: No
CUDA used to build PyTorch: 9.2

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: version 3.14.0

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 9.2.88
GPU models and configuration:
GPU 0: Quadro GP100
GPU 1: Quadro GP100

Nvidia driver version: 418.116.00
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] numpy==1.16.4
[pip] numpydoc==0.9.1
[pip] torch==1.5.0a0+a5161c7
[pip] torchtext==0.5.0
[conda] Could not collect

<!-- Add any other context about the problem here. -->

@albanD @vincentqb 

cc @vincentqb
Repository: TypeScript
Issue: Handle inlined sources in d.ts maps to support goto definition and other such functionalities
Labels: Needs Investigation

Found as part of #35014
Repository: flutter
Issue: Issues with properties in ThemeData and component properties they affect
Labels: framework,f: material design,d: api docs,P2,team-design,triaged-design

**What do each of the properties in ThemeData affect? If I want to change something, say the text style of a particular widget, how do I know which text style to change in ThemeData?**

Take this example: I wanted to have a specific text style for my AppBar (top app bar). I'm not sure if I'm not going about this correctly, but it took me a while to realize that it is `textTheme.title`, a property of `AppBarTheme()` that changes the app bar text style. I learned this by digging around the source for `textTheme()`. 

Also, for buttons, for the `textTheme`, I could put `ButtonTextTheme.primary`, or `ButtonTextTheme.secondary`. What exactly are the differences in these?

Same issue with colors. Is there a list of what each property (primary, accent, focus, indicator, highlight color) affect in your UI? I know I could dig into the source code of each widget and check for myself, but I feel that **there should be a list**. I made an issue about this, it seems that some progress is being made (#36624)

Relevant documentation: https://api.flutter.dev/flutter/material/ThemeData-class.html
Repository: vscode
Issue: Expose a dropdown on the sidebar for extensions
Labels: feature-request,api,ux,tree-views

<!-- 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. -->
Expose a dropdown on the side bar (see screenshot) to extensions to allow users switch between views within a view container. This can allow an extension to scale as the number of views increases, without having the need for an extension to have multiple icons in the activity bar. It also keeps the number of icons in the activity bar manageable for the users.
![image](https://user-images.githubusercontent.com/4393177/73089497-35127600-3e8b-11ea-811c-4f82640df074.png)

@misolori
Repository: flutter
Issue: Android versionCode calculation conflicts with iOS versioning
Labels: tool,framework,t: gradle,t: xcode,c: proposal,P2,team-framework,triaged-framework

I'm currently rolling our recently released Flutter application from `v1.0.0+109` to `v1.0.1+1`. This is expected of an iOS application, as this is now the 1st build of the new version of our application. However, in `gradle_utils:updateLocalProperties`, Flutter uses the build number to calculate the `versionCode`, which is expected to monotonically increase.

One alternative is to call the new version `v1.0.1+110`, which would preserve the given `versonCode` "calculation" by Flutter, while breaking the convention on iOS, as the builds would start with 110.

Another pair of alternatives involves changing Flutter:
- Flutter could use a separate field in `pubspec.yaml` or similar to allow application developers to provide their own, manually created `versionCode`.
- Flutter could calculate the `versionCode` from the otherwise-SemVer-honoring `version` field in `pubspec.yaml`. This would place restrictions on, say, the number of each kind of version a team could produce (to 10^3, 10^4, or similar) to make the math work, but would provide an internally consistent set of expectations across Flutter/Dart, iOS, and Android.
Repository: PowerToys
Issue: Horizontal scroll
Labels: Idea-New PowerToy

# Summary of the new feature/enhancement

Hi, everybody.

Is it possible to give us a key modifier for mouse horizontal scroll? Something like to hold ALT key and use the scroll button.

Thank you!
Repository: rust
Issue: Closure capturing itself results in unclear "mismatched types" error
Labels: A-diagnostics,A-closures,T-compiler,C-bug

Code:

```rust
fn main() {
    let mut r = None;
    
    let c = move || {
        let _r = r;
    };
    
    r = Some(c);
}
```

Results in this error:

```
error[E0308]: mismatched types
 --> src/main.rs:4:13
  |
4 |       let c = move || {
  |  _____________^
5 | |         let _r = r;
6 | |     };
  | |_____^ cyclic type of infinite size
```

This seems a bit unclear to me. What types don't match here?

There is special code in the compiler that is supposed to give a better error message, but for some reason it's not happening in this case:

https://github.com/rust-lang/rust/blob/73f76b74efcaf21bd5424d87c66cd6ed7fe5c7de/src/librustc/infer/error_reporting/mod.rs#L2003-L2006
Repository: pytorch
Issue: User-friendly handling of types and devices
Labels: triaged,module: numpy,module: ux

Some changes would make small-scale prototyping more user-friendly in PyTorch:

- Python types are automatically converted to PyTorch types
- integer types are treated numerically equivalent to their floating point version
- device mismatches are handled automatically

The last one is probably the most controversial. Implicit movement between devices causes hard-to-debug performance problems in large models. However, this problem could be solved with better tooling. Forgetting to add `.cuda()` will always trip people up

An example of workflow I just went through to check if my result is close to 1
```

torch.allclose(tensor.mean(), 1) # allclose(): argument 'other' (position 2) must be Tensor, not int
 
torch.allclose(tensor.mean(), torch.Tensor(1)) # output with device cuda:0 doesn't match the desired device cpu
 
torch.allclose(tensor.mean(), torch.Tensor(1).cuda()) # False....huh?...oh, need tensor, not Tensor...
 
torch.allclose(tensor.mean(), torch.tensor(1).cuda()) # Float did not match Long
 
torch.allclose(tensor.mean(), torch.tensor(1.).cuda()) # Success!
 
 ```


cc @mruberry @rgommers @heitorschueroff
Repository: TypeScript
Issue: cmd+click function name goes to type definition file instead of source
Labels: Suggestion,Awaiting More Feedback

duplicate of microsoft/vscode#68782 but that was closed without fix.

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version:  1.41.1
- OS Version: macOS 10.14.6

Steps to Reproduce:
1. Create a project folder with 2 files:

lib.js
```js 
export const testMethod = (name, params) => {
  params && params.age
    ? `hello ${name} with age: ${params.age}`
    : `hello ${name}`;
};
```

test.js
```js
import { testMethod } from "./lib";
testMethod("foo", { age: 3 });
```

cmd+click works and jumps to definition.

![no-type](https://user-images.githubusercontent.com/10415101/73053819-a3304c00-3e3d-11ea-9d43-3a7bade993ea.gif)

now add a type definition file

lib.d.ts
```ts
declare namespace MyModule {
  interface IParams {
    age: number;
  }

  function testMethod(name: string, params: IParams): string;
}
export = MyModule;
```

cmd+click jumps to type definition instead of source definition.

![with-type-file](https://user-images.githubusercontent.com/10415101/73053828-aa575a00-3e3d-11ea-8e22-bd2b3a458c4f.gif)

I do not think this should be the default behavior. I would expect cmd+click to bring me to the function definition.