sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: x/tools/go/packages: go list emits no CompiledGoFiles for packages that depend on one with an error
Labels: NeedsInvestigation,Tools

The TestLoadSyntaxError test case establishes an import graph a->b->c->d->e->f where e contains an error:

```
$ head $(find src -name \*.go)
==> src/golang.org/fake/d/d.go <==
package d; import "golang.org/fake/e"; const D = "d" + e.E
==> src/golang.org/fake/c/c.go <==
package c; import "golang.org/fake/d"; const C = "c" + d.D
==> src/golang.org/fake/f/f.go <==
package f; const F = "f"
==> src/golang.org/fake/e/e.go <==
package e; import "golang.org/fake/f"; const E = "e" + f.F + 1
==> src/golang.org/fake/b/b.go <==
package b; import "golang.org/fake/c"; const B = "b" + c.C
==> src/golang.org/fake/a/a.go <==
package a; import "golang.org/fake/b"; const A = "a" + b.B
``` 

If you run tip go list on a and c (as in the test), the reported set of CompiledGoFiles is accurate only for e and f, but not for any package above them, presumably because no build was attempted for those packages:
```
$ go list -compiled -f '{{.ImportPath}} {{.GoFiles}} {{.CompiledGoFiles}}' -deps -export golang.org/fake/a golang.org/fake/c 
# golang.org/fake/e
src/golang.org/fake/e/e.go:1:60: cannot convert "ef" (type untyped string) to type int
src/golang.org/fake/e/e.go:1:60: invalid operation: "ef" + 1 (mismatched types string and int)
golang.org/fake/f [f.go] [f.go]
golang.org/fake/e [e.go] [e.go]
golang.org/fake/d [d.go] []
golang.org/fake/c [c.go] []
golang.org/fake/b [b.go] []
golang.org/fake/a [a.go] []
```
Eliminating the type error cause go list to report CompiledGoFiles all the way up:
```
$ GOPATH=$(pwd) go list -compiled -f '{{.ImportPath}} {{.GoFiles}} {{.CompiledGoFiles}}' -deps -export golang.org/fake/a golang.org/fake/c 
golang.org/fake/f [f.go] [f.go]
golang.org/fake/e [e.go] [e.go]
golang.org/fake/d [d.go] [d.go]
golang.org/fake/c [c.go] [c.go]
golang.org/fake/b [b.go] [b.go]
golang.org/fake/a [a.go] [a.go]
```
This is arguably a bug in go list, but it suggests we need better test coverage and a more complex and better documented workaround for missing CompiledGoFiles than go/packages has today.
Repository: rust
Issue: assert! and assert_eq! generate different assembly
Labels: I-slow,A-codegen

Concidering this simple code

```rust

pub fn foo1(a: u32, b: u32) -> bool {
    assert!(a == b);
    true
}

pub fn foo2(a: u32, b: u32) -> bool {
    assert_eq!(a, b);
    true
}
```

The generate very different [assembly](https://rust.godbolt.org/z/_kFRkv)

```asm
example::foo1:
  push rax
  cmp edi, esi
  jne .LBB7_1
  mov al, 1
  pop rcx
  ret
.LBB7_1:
// panicing

example::foo2:
  sub rsp, 104
  mov dword ptr [rsp], edi
  mov dword ptr [rsp + 4], esi
  mov rax, rsp
  mov qword ptr [rsp + 8], rax
  lea rax, [rsp + 4]
  mov qword ptr [rsp + 16], rax
  cmp edi, esi
  jne .LBB8_1
  mov al, 1
  add rsp, 104
  ret
.LBB8_1: 
// panicing
```

There is a difference regarding the parameter formatting in the "assert_false" branch `LBB7_1` and `LBB8_1`, but what's even worse is, that the assert itself does differ and I don't see a reason why.
Repository: react
Issue: Textarea loses focus after inserting paired punctuation with Chinese IME
Labels: Type: Bug,Component: DOM

<!--
  Note: if the issue is about documentation or the website, please file it at:
  https://github.com/reactjs/reactjs.org/issues/new
-->

**Do you want to request a *feature* or report a *bug*?**
bug

**What is the current behavior?**
Textarea lose focus after insert paired punctuation by "Chinese-Pinyin 10 key" input source on IOS safari. And then textarea can't be focused when I click it. But after other element has been focused, the textarea could be focused again.

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:**

[CodeSandbox Demo](https://codesandbox.io/s/7w23wpl0q1)

[steps(youtube video)](https://youtu.be/4PJ2WVD83Eg)

**What is the expected behavior?**
just work fine!

**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**
versions of React: 16+
OS: IOS
browser: safari
Repository: TypeScript
Issue: Update Terminal's "--pretty" style.
Labels: Suggestion,In Discussion

I find the Pretty mode in TSC useful. But when there are multiple errors, it has so many spaces between each line that it becomes a pain for me to identify each error, even with the terminal in full size. Maybe I'm missing some setting?
![image](https://user-images.githubusercontent.com/1121725/48402668-18759c80-e724-11e8-859c-8e8b1f20490d.png)
It would be nice if the extra spaces were removed, something like this (also saves half of the terminal space):
![image](https://user-images.githubusercontent.com/1121725/48402697-29261280-e724-11e8-84aa-4dd3731eb86c.png)
If the terminal does not allow having an underline effect in the same text line, maybe a highlight effect like this is possible?
![image](https://user-images.githubusercontent.com/1121725/48402731-42c75a00-e724-11e8-9d43-dd0099068b3b.png)
Repository: create-react-app
Issue: What should the behavior of an exception inside a promise be?
Labels: issue: needs investigation

### Is this a bug report?
No/Maybe

I have a section of code (in typescript using "react-scripts": "2.1.1") that generates a promise that is used later.  Inside that promise, I occasionally will get a bad object, and expect the promise to be rejected as a result of an object being undefined.  Here's a pathological example, where I force the variable a to be undefined to illustrate the problem, which gives 
Unhandled Rejection (TypeError): Cannot read property 'toLowerCase' of undefined

 ```
     const a: any = undefined;
     cached = new Promise(async (resolve, reject) => {
          const ret = a.toLowerCase();
          resolve(ret);
    });
``` 

On chrome this generates an exception at runtime when running the debug build, which prevents any further use of the app, but does not on edge.

If instead, I rewrite it like this, it also fails on chrome.
 ```
     const a: any = undefined;
     cached = new Promise(async (resolve, reject) => {
        try {
          const ret = a.toLowerCase();
          resolve(ret);
        } catch (e) {
             throw(e);
        }
    });
``` 
This too fails, making it look like anything thrown that derives from error causes the message:
 ```
     const a: any = undefined;
     cached = new Promise(async (resolve, reject) => {
        try {
          const ret = a.toLowerCase();
          resolve(ret);
        } catch (e) {
             throw new Error("fix chrome");
        }
    });
``` 

however if I rewrite it like this, it does not fail on chrome.
 ```
     const a: any = undefined;
     cached = new Promise(async (resolve, reject) => {
        try {
          const ret = a.toLowerCase();
          resolve(ret);
        } catch (e) {
             throw "fix chrome";
        }
    });
```
Repository: opencv
Issue: Proposal: VideoCapture to drop frames for low latency still capture
Labels: priority: normal,feature,category: videoio(camera)

Use case: someone wants to capture still images. However the camera API, trying not to drop any frames, buffers several frames. This results in a pipeline of "stale" images when frames are read at less than full configured frame rate.

Those who don't know of this behavior, are often puzzled and don't know how to solve it.

The usual solution is to spawn a thread to read from VideoCapture without delay, and keep the most recent frame around for whatever requests it. This is often implemented from scratch by whoever needs this functionality. 

Idea: introduce a property/flag to cv::VideoCapture that would enable the described solution. A VideoCapture::read() should not return the same frame twice, i.e. it should block if the most recent frame was already read. This is usually implemented using std::condition_variable.

This might interact with #12077.

Some example code for the principle (and direct access to v4l) can be found here:
* http://triffid-hunter.no-ip.info/Camera.cpp
* http://triffid-hunter.no-ip.info/CameraTest.cpp
Repository: opencv
Issue: G-API: division test is disabled for MathOperatorTest
Labels: test,category: g-api / gapi

Testing of the divsion operation has been disabled by @alalek with PR #13096  

I am filing this issue in order to track fixing and re-enabling of these tests

Reasoning provided by @alalek about these tests:  

Div by exact zero has been changed in OpenCV 4.x (to follow IEEE 754 for floating point numbers): #12826  

Div by values near zero provides unreliable results.  
Small error in denominator provides has huge impact on result. So inputs should be "normalized" (avoided values near zero), or compare function should be based on input values too (it is not enough to provide "expected" and "actual" results only)
Repository: opencv
Issue: G-API: please fix the EqHistTest test
Labels: test,category: g-api / gapi

Issue description provided by @alalek with the PR #13096  

Implementation of (equalize histogram) function is not bit-exact (at least in OpenCV), so this test will broke soon with "exact" check.
Repository: godot
Issue: Manually linking static libraries with MSVC appends Godot's LIBSUFFIX
Labels: bug,platform:windows,topic:buildsystem,confirmed


[fmod.zip](https://github.com/godotengine/godot/files/2576922/fmod.zip)
<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:** 3.1
<!-- Specify commit hash if non-official. -->


**OS/device including version:** Windows
<!-- Specify GPU model and drivers if graphics-related. -->


**Issue description:**
It's very likely to be my fault, but I can't include the FMOD library when linking a custom module.
It's strange how the module itself compiles without problems, but when it comes to the "Linking program" step the compiler freezes for a bit and then outputs `fatal error LNK2019: unresolved external symbol "public: static enum FMOD_RESULT __cdecl FMOD::Studio::System::create(class FMOD::Studio::System * *,unsigned int)" in function "public: __cdecl FMod::FMod(void)"`.

**Minimal reproduction project:**
I placed the "FMOD Studio API Windows" under "thirdparty". The module itself basically contains just a call to FMOD's initialization function. I attached the module as a zip file.
For those who don't want to download the zip, here's the SCsub:
```python
Import('env')

fmodapifolder = "#thirdparty/FMOD Studio API Windows/api"

module_env = env.Clone()
module_env.add_source_files(env.modules_sources, "*.cpp")
module_env.Append(CPPPATH=fmodapifolder + "/studio/inc")
module_env.Append(LIBPATH=fmodapifolder + "/studio/lib")
module_env.Append(CPPPATH=fmodapifolder + "/lowlevel/inc")
module_env.Append(LIBPATH=fmodapifolder + "/lowlevel/lib")
```

Here's fmod.cpp:
```c++
#include "fmod.h"

FMod::FMod() {
	// Initialize fmod
	FMOD::Studio::System* system = NULL;
	FMOD::Studio::System::create(&system);
}

void FMod::_bind_methods(){
	// none
}
```

Here's fmod.h:
```c++
#ifndef FMODNODE
#define FMODNODE

#include "scene/main/node.h"
#include "fmod.h"
#include "fmod.hpp"
#include "fmod_common.h"
#include "fmod_studio.hpp"
#include "fmod_studio.h"
#include "fmod_studio_common.h"

class FMod : public Node {
	GDCLASS(FMod, Node);

protected:
	static void _bind_methods();

public:
	FMod();
};

#endif
```

Also, I don't know if this can help, but without any call to FMOD functions (only with the `includes`), scons compiles without any issue.
Repository: TypeScript
Issue: Rest tuple parameter with intersection/union places error on wrong argument
Labels: Bug,Domain: Error Messages

**TypeScript Version:**  3.2.0-dev.20181113

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
rest tuple, intersection, union, error, argument, misplaced

**Code**
```ts
declare function boop<T extends any[]>(...args: T & [number, string]): void;
boop(123, 456); // error
//   ~~~ <-- error on first argument
// Argument of type '[123, 456]' is not assignable to parameter 
//   of type '[number, number] & [number, string]'.
// Type '[123, 456]' is not assignable to type '[number, string]'.
// Type '456' is not assignable to type 'string'.
```
**Expected behavior:**
I expect an error on the second argument (`456`), since that's the argument that causes the failure, as made evident by the error message.  (Or possibly I expect an error on both arguments, if it's interpreted as a failure to match the rest parameter.)

**Actual behavior:**
The actual error is on the first argument (`123`).  This is a minor problem, and it only seems to show up in the intersection-with-type-parameter situation above (concrete types like `...args: [number, string] & [number, string]` work fine), but I figured I'd report it in case it has an easy fix.

(Note to self or interested non-selves: ran into this in a [Stack Overflow answer](https://stackoverflow.com/a/53175538/2887218))

**Playground Link:** 
[🔗](https://www.typescriptlang.org/play//#src=declare%20function%20boop%3CT%20extends%20any%5B%5D%3E%28...args%3A%20T%20%26%20%5Bnumber%2C%20string%5D%29%3A%20void%3B%0Aboop%28123%2C%20456%29%3B%20%2F%2F%20error%0A%2F%2F%20%20%20~~~%20%3C--%20error%20on%20first%20argument%0A%2F%2F%20Argument%20of%20type%20%27%5B123%2C%20456%5D%27%20is%20not%20assignable%20to%20parameter%20%0A%2F%2F%20%20%20of%20type%20%27%5Bnumber%2C%20number%5D%20%26%20%5Bnumber%2C%20string%5D%27.%0A%2F%2F%20Type%20%27%5B123%2C%20456%5D%27%20is%20not%20assignable%20to%20type%20%27%5Bnumber%2C%20string%5D%27.%0A%2F%2F%20Type%20%27456%27%20is%20not%20assignable%20to%20type%20%27string%27.)

**Related Issues:** 
Haven't found anything.  Anyone find anything?
Repository: flutter
Issue: Using ChangeNotifier as a mixin is messing with the super.dispose() call in a StatefulWidget
Labels: framework,dependency: dart,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

I'm seeing an issue which feels like a Flutter bug. 
I have a StatefulWidget which has a state class that looks like this
```dart
class _SearchScreenTabsContainerState extends State<SearchScreenTabsContainer>
    with SingleTickerProviderStateMixin, ChangeNotifier { ... }
```
I've added the ChangeNotifier class  so that I can call `textController.notifyListeners();` when changing tabs to refresh my tab content. However by implementing the ChangeNotifier mixin my dispose method which looks like this
```dart
  @override
  void dispose() {
    textController.dispose();
    super.dispose();
  }
``` 
throws an error `_SearchScreenTabsContainerState.dispose failed to call super.dispose.`
I found a [SO](https://stackoverflow.com/questions/48678788/flutter-screenstate-dispose-method-exception) thread of someone having the same problem and the solution was to remove the ChangeNotifier mixin, because it looks like the `super.dispose()` call, calls into the ChangeNotifier's dispose method instead of the State's. 
I can remove the ChangeNotifier mixin and my code still works (and I don't see the error) but when adding `textController.notifyListeners();` I get this warning "_The member 'notifyListeners' can only be used within instance members of subclasses of 'ChangeNotifier'_". 

I might be doing something wrong as I'm very new to Flutter, but this felt worth raising to check if it's indeed a bug or not.

Here's my Flutter doctor output
```
Flutter (Channel beta, v0.9.4, on Mac OS X 10.13.3 17D47, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[!] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    ✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To install:
        brew install cocoapods
        pod setup
[✓] Android Studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.1.5)
[✓] VS Code (version 1.25.1)
[✓] Connected devices (1 available)
```
Repository: rust
Issue: Rust incorrectly infers the generic type if used with failure::ResultExt and the try macro.
Labels: A-trait-system,T-compiler,A-inference,C-bug

When trying to compile the following code, the compiler will incorrectly infer the type as `()`.
It shouldn't happen, since the returned type is `Result<U, _>` and `context` doesn't change the generic value type in `Result.`

```
extern crate serde;
extern crate failure;
extern crate reqwest;
use serde::{Deserialize, Serialize};
use failure::{Fallible, ResultExt, format_err};

fn post<T, U>(json: T) -> Fallible<U>
where
    T: Serialize,
    for<'a> U: Deserialize<'a>,
{
    let client = reqwest::Client::new();
    let url = "http://someurl.com";
    let mut resp = client.post(url).json(&json).send()?;
    let resp_content: Result<U, String> = resp.json().context("Bad JSON")?;
    resp_content.map_err(|e| format_err!("Provider replied: {:?}", e))
}

fn run() -> Fallible<()> {
    // works fine, the error is:
    //      error[E0282]: type annotations needed
    //let ret = post("foo").expect("blah");

    // This incorrectly infers the type `()` instead of requiring type annotations. 
    // The compilation fails in the `println` line
    //      error[E0277]: `()` doesn't implement `std::fmt::Display`
    let ret = post("foo").context("blah")?;

    // Here the typecheck succeeds
    // let ret: String = post("foo").context("blah")?;
    println!("{}", ret);
    Ok(())
}

fn main() {
    run().unwrap();
}
```

The dependencies in `Cargo.toml`:
```
[dependencies]
failure = "0.1"
serde = "1.0"
reqwest = "0.9"
```

This happens on both Rust 1.30.1 and 1.32.0-nightly (65204a97d 2018-11-12)
It is clearly a compiler bug: if both `()` and `String` are correct types, then the type inference should fail.
Repository: rust
Issue: Lifetime is somehow treated as invariant where it shouldn't be
Labels: A-lifetimes

Original code using [combine](https://crates.io/crates/combine) v3.6.2 (self-contained reproduce code can be found below):
```rust
use combine::parser::{Parser, range::take, char::string};
fn func<'a>(source: &'a str) {
    take(1).or(string("a")).parse(source);   // error
}
```
The code should compiles.
Instead, this happened:
```
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
 --> src\main.rs:3:35
  |
3 |     take(1).or(string("a")).parse(source);
  |                                   ^^^^^^
  |
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 2:9...
 --> src\main.rs:2:9
  |
2 | fn func<'a>(source: &'a str) {
  |         ^^
  = note: ...so that the expression is assignable:
          expected &str
             found &'a str
  = note: but, the lifetime must be valid for the static lifetime...
  = note: ...so that the types are compatible:
          expected &str
             found &'static str
```

With NLL, error is stranger:
```
error[E0521]: borrowed data escapes outside of function
 --> src\main.rs:4:6
  |
3 | fn func<'a>(source: &'a str) {
  |             ------ `source` is a reference that is only valid in the function body
4 |      take(1).or(string("a")).parse(source);
  |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `source` escapes the function body here
```
However, slightly modified code
```rust
fn func<'a>(source: &'a str) {
    take(1).or(string("a").map(|x| x)).parse(source);   // ok
}
```
compiles fine.

I made a self-contained repro:
```rust
use std::marker::PhantomData;

pub struct ParserS<I, O>(PhantomData<fn(I) -> O>);
pub trait Parser: Sized {
    type I;
    type O;
    fn or<P: Parser<I = Self::I, O = Self::O>>(self, _: P) -> ParserS<Self::I, Self::O> { ParserS(PhantomData) }
    fn parse(self, _: Self::I) { }
}
impl<I, O> Parser for ParserS<I, O> {
    type I = I;
    type O = O;
}

fn take<'a>() -> ParserS<&'a str, &'a str> {
    ParserS(PhantomData)
}

pub struct Str<I>(PhantomData<fn(I) -> &'static str>);
impl<I> Parser for Str<I> {
    type I = I;
    type O = &'static str;
}

pub fn string_bad<'a>() -> Str<&'a str> {
    Str(PhantomData)
}

pub fn string_ok<'a>() -> ParserS<&'a str, &'static str> {
    ParserS(PhantomData)
}

pub fn func<'a>(source: &'a str) {
    // error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
    take().or(string_bad()).parse(source);
    // however, this equivalent code compiles
    take().or(string_ok()).parse(source);
}
```

## Meta
```
rustc 1.32.0-nightly (15d770400 2018-11-06)
binary: rustc
commit-hash: 15d770400eed9018f18bddf83dd65cb7789280a5
commit-date: 2018-11-06
host: x86_64-pc-windows-gnu
release: 1.32.0-nightly
LLVM version: 8.0
```
Also reproduced on playground's stable/beta/nightly.
Repository: vscode
Issue: Ability to apply a final sort to QuickPick results
Labels: feature-request,quick-pick

I'd like to be able to pin certain items to the top of a QuickPick list, but the QuickPick's fuzzy matching functionality doesn't allow any custom sorting. Providing some kind of hook to apply a final sort would solve this. This hook would receive the fuzzy-matched order and could return a new array for the final order.
Repository: pytorch
Issue: Pytorch very slow to convert list of numpy arrays into tensors
Labels: high priority,module: performance,triaged,enhancement,module: numpy,has workaround

## 🐛 Bug

I compared the execution time of two codes.

Code 1:
```
import torch
import numpy as np

a = [np.random.randint(0, 10, size=(7, 7, 3)) for _ in range(100000)]
b = torch.tensor(np.array(a))
```
And code 2:
```
import torch
import numpy as np

a = [np.random.randint(0, 10, size=(7, 7, 3)) for _ in range(100000)]
b = torch.tensor(a)
```

The code 1 takes less than 1 second to execute (used `time`):
```
real    0m0,915s
user    0m0,808s
sys     0m0,330s
```

Whereas the code 2 takes 5 seconds:
```
real    0m6,057s
user    0m5,979s
sys     0m0,308s
```

## Expected behavior

I would expect code 2 to be as fast as code 1.

## Environment

 - PyTorch 0.4.1
 - Linux
 - OS (e.g., Linux):
 - Installed with `conda`
 - Python version: 3.6


cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @mruberry @rgommers @heitorschueroff @VitalyFedyunin @ngimel