sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Suggestion: consolidate generics in union if they match
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 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 `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.5.2

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** rxjs startWith generics union consolidate same

**Code**

```ts
declare const create: <T>(
    t: T,
) => {
    startWith: <D>(v1: D) => T | D;
};

// Succeeds
// $ExpectType { foo: number } | { bar: number }
const r1 = create({ foo: 1 }).startWith({ bar: 1 });

// Fails
// $ExpectType { foo: number }
// Actual: { foo: number } | { foo: number }
const r2 = create({ foo: 1 }).startWith({ foo: 1 });
```

Although the expected/actual types are compatible, it's slightly irritating to deal with a union type `T | T` instead of a consolidated type `T`, as it makes type inspection in VS Code much more difficult (especially when the types are large or deeply nested).

Real world use case: https://github.com/ReactiveX/rxjs/issues/4866
Repository: pytorch
Issue: Crash when using tensor.set_data() function in libtorch on windows
Labels: module: cpp,triaged

## ❓ Questions and Help
When i use the the set_data function in libtorch as following, the exe will be crashed! 
at:: Tensor a = torch::ones({3});
at::Tensor b = torch:: zeros({3});

a.set_data(b)
....
? do anyone know what's going on?

Thanks


### Please note that this issue tracker is not a help form and this issue will be closed.

We have a set of [listed resources available on the website](https://pytorch.org/resources). Our primary means of support is our discussion forum:

- [Discussion Forum](https://discuss.pytorch.org/)
Repository: TypeScript
Issue: No auto-completion on typescript interface with classes implement
Labels: Suggestion,Experience Enhancement

Redirected by https://github.com/microsoft/vscode-cpptools/issues/3789

**Type: LanguageService**
**Describe the bug**
- macOS Mojave 10.14.5
- VSCODE : 1.35.1
- TS 3.5.1


**To Reproduce**

Create a file with the following : 
```ts
import { Strategy } from "passport-local";

class SSOPlugin implements Plugin {

  constructor() {}

  init() {}
}

interface Plugin {
  authenticators?: Record<string, any>;

  strategies: { [key: string]: KuzzleStrategy };
}

interface KuzzleStrategy {
  config: {
    authenticator: string;
    fields: string[];
  };
  methods: {
    afterRegister?: () => any;
    create: () => any;
    delete: () => any;
    exists: () => any;
    getById?: () => any;
    getInfo?: () => any;
    update: () => any;
    validate: () => any;
    verify: () => any;
  };
}

export = SSOPlugin;
```

In constructor or any method using `this.` and auto-completion doesn't give anything.

But if I give the wrong types, the compiler complain (also red line on IDE).

**Expected behavior**

I should get auto-completion.
Repository: pytorch
Issue: contradictory output values
Labels: module: cpp,triaged

Hello please find following description:

Hello, when I debug this project, input same images and output different values respectively in Python env. and in c++ env. . However, input torch::ones({1,1,224,224}) and output same values. Am I missing some details in bgr2tensor？
C++ API release is much slower than Python API in the same system environment. Inputting a (1,1,224,224) tensor resumes about 0.2 s/tensor in Python API inference.(ResNet18 replaced Conv1 and Linear Layers)However, it resumes about 1.9 s/tensor in C++ API inference. And I sure that loading model time is not included because I set clock_ts respectively at the beginning and the end of "auto output = module->forward(inputs).toTensor();". In addition, my gpu device is RTX2080Ti.

Following code:
```cpp
void bgr2tensor(const char * path, torch::Tensor &output)
{
Mat img = imread(path, 0);
if (img.empty()) {
printf("load image failed!");
system("pause");
}

cv::resize(img, img, { 224,224 });
img.convertTo(img, CV_32F, 1.0 / 255.0);
//cv::cvtColor(img, img, cv::COLOR_BGR2RGB);
auto img_tensor = torch::from_blob(img.data, { 1,224,224,1 }, torch::kFloat32);// opencv H x W x C  torch C x H x W
img_tensor = img_tensor.permute({ 0,3,1,2 });
//img_tensor = img_tensor.toType(torch::kFloat32);
//img_tensor = img_tensor.div(255);

//img_tensor[0][0] = img_tensor[0][0].sub_(0.485).div_(0.229);
//img_tensor[0][1] = img_tensor[0][1].sub_(0.456).div_(0.224);
//img_tensor[0][2] = img_tensor[0][2].sub_(0.406).div_(0.225);

output = img_tensor.clone();
}
int main()
{
// ..............
bgr2tensor("D:\pic1\Class10\Class10\Test\0045.png", dog);
dog = dog.to(at::kCUDA);
at::Tensor output = module->forward({ dog }).toTensor();
// ...............
}
```
Repository: rust
Issue: Should warn when calling blanket implementation of a method rather than our own
Labels: C-enhancement,A-lints,T-compiler

The following snippet crashes:
```
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)
```

```rust
use std::fmt;

struct Badger;

impl Badger {
    fn to_string<'a>(self) -> &'a str {
        "badger"
    }
}

impl fmt::Display for Badger {
    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        f.write_str(&self.to_string())
    }
}

fn main() {
    let b = Badger {};
    println!("{}", b);
}
```

`fmt()` calls the blanket implementation of `ToString`, which is using `Display`, instead of our own implementation resulting in an infinite recursion.

We wouldn't have the problem if our function was taking `&self` but that's still pretty confusing and prone to errors. It would be good to have at least a warning (or a clippy lint?) for such patterns.
Repository: go
Issue: proposal: spec: allow untyped float const multiplied by typed integer constants (2.5*time.Hour)
Labels: LanguageChange,Proposal,LanguageChangeReview

### What version of Go are you using (`go version`)?

<pre>
play.golang.org reports 1.12.5
</pre>

### What did you do?
https://play.golang.org/p/klT3SFB7BJE

### What did you expect to see?
2h30m0s

### What did you see instead?
./prog.go:9:23: constant 2.5 truncated to integer

In the code I'm multiplying a constant with a constant and according to https://blog.golang.org/constants this should just work. But somehow it doesn't.
Repository: TypeScript
Issue: noImplicitThis codefix should account for static functions
Labels: Suggestion,Awaiting More Feedback

## Search Terms

codefix static this noImplicitThis

## Suggestion

If a function is used as the initializer of a `static` property declaration, should the type of its `this` added by the `--noImplicitThis` codefix include `typeof`?

See discussion in #31138.

## Use Cases

Static methods are arguably more likely to be called with the static class as their `this` scope in common practice. This would more accurately reflect that behavior.

## Examples

```ts
const returnThisMember = function ([| |]) {
    return this.member;
}

class Container {
    member = "sample";
    static returnThisMember = returnThisMember;
};
```

Right now `[| |]` just becomes `this: Container`.

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: TypeScript
Issue: Intellisense mismatch for overload function vs paramaters
Labels: Bug

<!-- 🚨 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 `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.5.1, 3.6.0-dev.20190618

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
overload resolution intellisense

**Code**

```ts
declare var f: {
    (a: string, b: number): void;
    (a: number, b: number): void;
}

f( // shows the (string, number) overload
    "a",
    1
);

f( // shows the (number, number) overload
    1,
    1
);

f( // shows the (string, number) overload...
    "a", // but the parameter mismatch error is about the (number, number) overload
    "a"
);
```

**Expected behavior:**
When an overload is resolved correctly and all types match, hovering the function will tell you which overload it is and what the type signature of the overload is.  That's fine and works fine.

When no overload resolves, then errors are given on parameters that failed to match the _last_ overload.  That's fine and works fine.  In this situation, I would expect hovering the function to also give the _last_ overload, since that's the one that the errors are for.

**Actual behavior:**

But in those situations, hovering the function seems to give the _first_ overload.

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
https://www.typescriptlang.org/play/#src=declare%20var%20f%3A%20%7B%0D%0A%20%20%20%20(a%3A%20string%2C%20b%3A%20number)%3A%20void%3B%0D%0A%20%20%20%20(a%3A%20number%2C%20b%3A%20number)%3A%20void%3B%0D%0A%7D%0D%0A%0D%0Af(%20%2F%2F%20shows%20the%20(string%2C%20number)%20overload%0D%0A%20%20%20%20%22a%22%2C%0D%0A%20%20%20%201%0D%0A)%3B%0D%0A%0D%0Af(%20%2F%2F%20shows%20the%20(number%2C%20number)%20overload%0D%0A%20%20%20%201%2C%0D%0A%20%20%20%201%0D%0A)%3B%0D%0A%0D%0Af(%20%2F%2F%20shows%20the%20(string%2C%20number)%20overload...%0D%0A%20%20%20%20%22a%22%2C%20%2F%2F%20but%20the%20parameter%20mismatch%20error%20is%20about%20the%20(number%2C%20number)%20overload%0D%0A%20%20%20%20%22a%22%0D%0A)%3B%0D%0A

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
I was not able to find any related issues.
Repository: flutter
Issue: Make it easier for contributors to run all tests in Flutter repository
Labels: a: tests,c: new feature,tool,P3,team-tool,triaged-tool

## Use case
Flutter contributors should be able to locally run all repository unit tests at one time to fix issues before issuing a pull request and have some confidence the CI system tests will pass.

## Proposal
Add a --flutter-repo flag to `flutter test` to match `flutter analyze --flutter-repo`.  At a minimum the tests should run the list at `_runTests()`.
Repository: rust
Issue: Missed optimizations for Vec::pop() followed by Vec::push()
Labels: I-slow,C-enhancement,A-collections,T-compiler

The following example should be get optimized to a no-op by the compiler:
```rust
pub fn noop(v: &mut Vec<i32>) {
    if let Some(last) = v.pop() {
        v.push(last)
    }
}
```
Instead, it produces about 60 lines of assembly, which also contain calls to `__rust_alloc()` and `alloc::raw_vec::capacity_overflow()`.
The following code is better:
```rust
pub fn noop(v: &mut Vec<i32>) {
    if let Some(last) = v.pop() {
        assert!(v.len() < v.capacity());
        v.push(last)
    }
}
```
producing:
```asm
example::noop:
        push    rax
        mov     rax, qword ptr [rdi + 16]
        test    rax, rax
        je      .LBB7_3
        lea     rcx, [rax - 1]
        mov     qword ptr [rdi + 16], rcx
        cmp     rcx, qword ptr [rdi + 8]
        jae     .LBB7_4
        mov     qword ptr [rdi + 16], rax
.LBB7_3:
        pop     rax
        ret
.LBB7_4:
        call    std::panicking::begin_panic
        ud2
```
And even better:
```rust
pub fn noop(v: &mut Vec<i32>) {
    if let Some(last) = v.pop() {
        if v.capacity() <= v.len() {
            unsafe { std::hint::unreachable_unchecked() }
        }
        v.push(last)
    }
}
```
producing:
```asm
example::noop:
        ret
```

[Compiler explorer](https://godbolt.org/z/lQS6Pr)

I feel like the compiler should be able to handle this situation better, considering that all the information is readily available.
Repository: vscode
Issue: [folding] folding indicators missing for folded code
Labels: bug,editor-folding

Issue Type: <b>Bug</b>

For some time the visual studio code has been blocked, it does not display the fragments of code.

Suppose I have a code fragment inside an if, when it is blocked accessing this code inside the if is impossible, it is necessary to close the visual code and re-enter sometimes it happens up to 10 times in the day


![image](https://user-images.githubusercontent.com/39317116/59722477-6508e500-91e9-11e9-8ac5-c07addf4601f.png)

access the points marked with the red arrow when it is blocked you can not


In this image you can see how the code can not be accessed

![image](https://user-images.githubusercontent.com/39317116/59722614-b87b3300-91e9-11e9-994a-f5a091667fdf.png)


VS Code version: Code 1.35.1 (c7d83e57cd18f18026a8162d042843bda1bcf21f, 2019-06-12T14:30:02.622Z)
OS version: Windows_NT x64 10.0.17134

<details><summary>Extensions (18)</summary>

Extension|Author (truncated)|Version
---|---|---
html-snippets|abu|0.2.1
bracket-pair-colorizer|Coe|1.0.61
angular2-snippets|dan|1.0.21
githistory|don|0.4.6
vscode-html-css|ecm|0.2.0
tslint|eg2|1.0.43
auto-close-tag|for|0.5.6
auto-rename-tag|for|0.1.0
Angular2|joh|8.1.1
vscode-extension-auto-import|mop|1.3.3
vscode-language-pack-es|MS-|1.35.1
atom-keybindings|ms-|3.0.6
csharp|ms-|1.20.0
powershell|ms-|2019.5.0
al-formatter|ras|3.0.0
vscode-icons|vsc|8.7.0
JavaScriptSnippets|xab|1.7.2
tslint-snippets|zuo|1.1.0


</details>
<!-- generated by issue reporter -->
Repository: flutter
Issue: CommonFinders.text does not find TextSpan widget created with RichText 
Labels: a: tests,framework,a: typography,has reproducible steps,P2,found in release: 3.3,found in release: 3.6,team-framework,triaged-framework

I'm using a widget tree like:
```
return RichText(
    text: TextSpan(
        children: [
            TextSpan(text: "Hello "),
            TextSpan(text: "World"),
        ]
    )
);
````

but 
``` expect(find.text('Hello World'), findsOneWidget);```

fails, I expect it would be able to find this text

related to #19267
Repository: rust
Issue: Misleading `use foo::bar` error message
Labels: C-enhancement,A-diagnostics,A-resolve,T-compiler,D-papercut

Here are two slightly different sources with slightly different errors:

```
use foo;

fn main() { }
```

```
error[E0432]: unresolved import `foo`
 --> src/main.rs:1:5
  |
1 | use foo;
  |     ^^^ no `foo` external crate
```

```
use foo::bar;

fn main() { }
```

```
error[E0432]: unresolved import `foo`
 --> src/main.rs:1:5
  |
1 | use foo::bar;
  |     ^^^ use of undeclared type or module `foo`
```

For `use foo`, the error is "no foo external crate"; for `use foo::bar` it is "undeclared type or module foo".

The first error I think is unambiguously correct - there's nothing foo could be but an external crate. The second though is failing to mention that foo could very will be a missing crate. And it may be more likely to be a missing crate (or a typo...) than a type or module that hasn't been imported.

I encountered this second error while writing some training material and had to explain that the error is misleading and that actually you need to list crate foo in your manifest.

A better error might be "use of undeclared crate, type, or module" (while also changing the first one to "use of undeclared crate" for consistency), or "no foo extern crate, or use of undeclared type or module foo". Even better might be to do some analysis to see if there is any crate with a name close to "foo", whether there are any internal names equal to or similar to "foo", and customize the error based on that.

This is using whatever nightly is current right now.
Repository: godot
Issue: Miter limit should be parameter with default value, not hardcoded.
Labels: enhancement,topic:core

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
3.2

**Issue description:**
When using offset_polygon_2d with JOIN_MITER join type it cuts nesessary geometry sometimes:

![ml](https://user-images.githubusercontent.com/7192155/59737480-e22a6d80-926e-11e9-915e-459cd357628f.png)

On the left is what is needed. On the right is what offsetting polygon gives.

Please, add this! Original library allows miter limit to be set.
Repository: TypeScript
Issue: better autocompletion for dicriminated union as tuples
Labels: Suggestion,Experience Enhancement

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.

-->

## Search Terms
autocompletion, tuple, tagged union
<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

## Suggestion

<!-- A summary of what you'd like to see added or changed -->

## Use Cases
https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions
Discriminated unions of tuples is just the same in semantic with discriminated unions with object introduced in the official document of typescript.
And the type check for it is working correctly for now.
But the autocompletion for tuples isn't as powerful as one for objects.
Sometimes discriminate unions as objects are verbose so it leads us to write some sort of constructors for each variant. But tuples can solve this problem, and it even looks more similar to haskell's `data` and rust's `enum`.

## Examples

<!-- Show how this would be used and what the behavior would be -->
```typescript
// discriminated union as tuples
type A = ["a", { a: number }] | ["b": { b: number }];
const a: A = ["a", { /* both a and b are suggested when you fill in here */ }];
const b: A = ["b", { a: 1 }]; // type check works correctly! typescript tell us it's invalid.

// discriminated union as objects
type C = {
    tag: "a",
    a: number
} | {
    tag: "b",
    b: number
};
const c: C = { tag: "b", /* only b is suggested! */ };
```

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: pytorch
Issue: nn.init.orthogonal_ doesn't work with multiprocessing
Labels: module: dependency bug,module: multiprocessing,module: nn,triaged,module: initialization

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

## To Reproduce

Steps to reproduce the behavior:

```
import torch.nn as nn
import torch.multiprocessing as mp
import time
def test():
    print("test in")
    layer = nn.Linear(5 * 5 * 64, 64)
    nn.init.orthogonal_(layer.weight.data)
    print("test out")
processes = []
test()
for rank in range(0, 1):
    p = mp.Process(target=test)
    p.start()
    processes.append(p)
    time.sleep(0.1)
for p in processes:
    time.sleep(0.1)
    p.join()
print('t')
```
output:
test in
test out
test in
t

cc @albanD @mruberry
Repository: godot
Issue: can't use Rigigbody2D's apply_impulse and apply_torque_impulse when in _ready() function
Labels: bug,topic:physics

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
<!-- Specify commit hash if non-official. -->
d2f38dbb28053e47cd6a0f8b368ade5c19d5ca70

**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->


**Issue description:**
<!-- What happened, and what was expected. -->
Create a normal rigidbody2D in scene, attach a script to it, and try to call `apply_impulse` or `apply_torque_impulse` in `_ready()`,it has no effect.
Reason:  Rigidbody2d's updating inertia is delayed to next frame, so when you call a function need mass or inertia in `_ready()`, it has no effect.
https://github.com/godotengine/godot/blob/d2f38dbb28053e47cd6a0f8b368ade5c19d5ca70/servers/physics_2d/body_2d_sw.cpp#L36-L40

RigidBody has the same problem, the difference is RigidBody's inertia is inited with identity instead of zero.
**Steps to reproduce:**


**Minimal reproduction project:**
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
[bug2.zip](https://github.com/godotengine/godot/files/3304587/bug2.zip)
Repository: godot
Issue: Add highlight to current script to Scene Tree.
Labels: enhancement,topic:editor

**Godot version:**
3.2 master

**Issue description:**
Now when I open a script, I see its name in script editor, but I don't know to which node is connected in current scene. It will be really helpful when Godot would highlight somehow a script button in scene tree

![Zrzut ekranu z 2019-06-19 08-11-13](https://user-images.githubusercontent.com/41945903/59741119-54e51a00-926a-11e9-9552-09b2eaf34f82.png)
Repository: flutter
Issue: Flutter slider should have the feature to show value indicator all the time, not just while gesturing
Labels: c: new feature,framework,f: material design,customer: crowd,P2,team-design,triaged-design

## Use case

- While using flutter [inbuilt slider widget ](https://api.flutter.dev/flutter/material/Slider-class.html) I encountered the issue that **value indicator is only shown while the gesture is present and not always.**

- I think the widget should also expose the property of showing the value indicator every time and not only when gesture is there.

## Proposal

- The [SliderTheme](https://api.flutter.dev/flutter/material/SliderThemeData-class.html) exposes the property which is [showValueIndicator](https://api.flutter.dev/flutter/material/SliderThemeData/showValueIndicator.html), it maintains an enum which lets the developer decide when to show the value indicator, there should be an additional property in that enum which lets the user show the valueIndicator every-time.