sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Explain why private and protected members in a class affect their compatibility
Labels: Docs

**TypeScript Version:**  up to 2.5.2 at least

In [the doc](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Type%20Compatibility.md#private-and-protected-members-in-classes) a short paragraph explains that private and protected members in a class affect their compatibility.

I have been searching for a while in the design goals, on SO etc... but could not find a decent explanation of the rationale. Could we:
* either document the rationale (in the paragraph above?
* or consider evolving the language?

Note: I found [one rationale](https://github.com/Microsoft/TypeScript/issues/7755#issuecomment-204161372) close to what I am looking for, but you could imagine that the language "reserves" the private names but does not compel to use them.

**Code**
This behavior is especially an issue in unit testing where you want to **mock** a class, disregarding its internals...

```ts
class MyClass {
    pubfield = 0;
    private privfield1 = 0;
    constructor(private privfield2: number) {}
    private method(): void {}
}

class MyClassMock implements MyClass {
    pubfield: number;
    // *** compile errors on missing properties ***
}
```

**Expected behavior:**
I would like to only care about the public contract that a class-under-test can possibly use from my mock.

**Actual behavior:**
I cannot limit my mock to the public fields.

The ugly workaround I found is the following:

```ts
class MyClass {
    pubfield = 0;
    private privfield1? = 0;
    private privfield2? = 0;
    // do not use the shortcut notation because the constructor param is not optional!
    constructor(privfield2: number) {
        this.privfield2 = privfield2;
    }
    private method?(): void {}
}

class MyClassMock implements MyClass {
    pubfield: number;
}
```

What I do not like is that I have to modify the semantics of my class to be able to mock it and that I am scared that a future overzealous refactoring may use the shortcut notation for fields declaration in the constructor... making the constructor param optional (!)
Repository: rust
Issue: Rustc failed to resolve trait bounds for trait implementation
Labels: C-enhancement,T-compiler

While trying to do some magic with traits I've stumbled over the following issue:
Rustc is telling me that some trait bound is missing and suggest to add this bound. Now is the issue that exactly this bounds is already in the where clause. 

More or less minimal self contained [example](https://play.rust-lang.org/?gist=6e08519836ad5752e79d15fb89183a26&version=nightly)

Workaround:
Replace every occurrence of `Collection` in the `Factory` trait  with `Vec<TypeA>`, but this removes the freedom the add additional impl's of `Factory` using other collection types.
Repository: vscode
Issue: Extract the integrated terminal
Labels: feature-request,workbench-cli,terminal-editors

"Feature" request.

The integrated terminal grows in functionality, to the point that it could soon become very useful standalone, as its *own app*. I'm only a casual VScode user (using vim most of the time), but I would definitely be interested in a well-behaved, consistent, reactively-configurable, multi-platform terminal not tied to the editor.

Obviously if such a situation were to unfold, the shared component (not entirely dissimilar to VTE) should be jointly developed and shared with VScode. Both could be able to leverage a common configuration so that whether a terminal leveraging such a theoretical common component is spawned within VScode or standalone, they behave the same.

---

Edit from @Tyriar:

There is some confusion about the scope of this issue, here is the clarification as the thread is long:

- This issue is tracking making the terminal "stand alone", ie. being able to launch `code --term` for example (see https://github.com/microsoft/vscode/issues/34442#issuecomment-901959244 for details)
- #10121 tracks being able to pull the terminal _view_/_panel_ out of the window
- #10546 tracks adding tabs to the terminal, combined with #10121 this would ideally allow terminal _tabs_ to be pulled into a separate window
Repository: rust
Issue: Cast error doesn't suggest boxed traits but maybe it should.
Labels: A-diagnostics,T-compiler,A-coercions,D-terse,S-has-mcve

I have a function call that's something like:

```rust
test(&[&"nani?" as &_, &"=_=".to_owned() as &_]);
```

The first `&_` is interpreted as a no-op cast, and the second is interpreted as a `&String -> &&str`. I did this to try and get a list of boxed traits, but the error message is pretty misleading unless you notice what the compiler's actually inferring, and almost makes it sound like `as` can't be used in this situation at all:

```
error[E0605]: non-primitive cast: `&std::string::String` as `&&str`
...
  = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
```

I don't know how, but it would be nice if it could automagically recommend boxed traits in similar situations.

[Playground](https://play.rust-lang.org/?gist=03ad4c524bc9474ee351d8a88ff2f495&version=stable)
Repository: rust
Issue: Improve borrowck error message for nested flat_map
Labels: C-enhancement,A-diagnostics,T-compiler

Take the following code:

```rust
struct Foo { x: String }

impl Foo {
    fn one(&mut self) -> Vec<String> { vec![] }
    fn two(&mut self) {
        let z: Vec<Vec<String>> = Default::default();
        let _: Vec<_> = z.into_iter()
            .flat_map(|xs| xs.into_iter().flat_map(|_| self.one()))
            .collect();
    }
}
```

This code fails to compile with
```console
error[E0598]: lifetime of `self` is too short to guarantee its contents can be safely reborrowed
 --> src/main.rs:8:52
  |
8 |             .flat_map(|xs| xs.into_iter().flat_map(|_| self.one()))
  |                                                    ^^^
  |
note: `self` would have to be valid for the method call at 7:25...
 --> src/main.rs:7:25
  |
7 |           let _: Vec<_> = z.into_iter()
  |  _________________________^
8 | |             .flat_map(|xs| xs.into_iter().flat_map(|_| self.one()))
9 | |             .collect();
  | |______________________^
note: ...but `self` is only valid for the lifetime  as defined on the body at 8:23
 --> src/main.rs:8:23
  |
8 |             .flat_map(|xs| xs.into_iter().flat_map(|_| self.one()))
  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

Though that is not particularly helpful in terms of identifying the underlying issue, namely that the inner flat map returns a closure whose lifetime is associated with `self`, preventing `self` from being used again when the outer closure is called again. I think. I'll let @nikomatsakis explain (reformatted from IRC):

> basically you wind up with two ways to access `self`. easiest fix is certainly to call `collect()`. you are returning *the closure* as part of the iterator you return and *that closure* that you return has captured `self`, but the *outer closure* (which exists at the same time as the inner closure) also has captured self (so it can pass it to the inner closure). we have no way to know that the iterator will fully drain and discard the inner closure before re-invoking the outer closure

> interesting test case; I wonder how on earth we could give an error that explains it better :P
> do you suppose you could open an issue with that example and a brief summary (as an A-diagnostics puzzler)
Repository: opencv
Issue: Access violations when using getUMat
Labels: incomplete

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => 3.2
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015

##### Detailed description

I have a code that uses `cv::Mat` frames from video streams and runs a bunch of different algorithms including filtering the images using `cv::blur` or face detection using `detectMultiScale`. If I let the code run on a few cameras for days, it works totally fine, no crash or whatsoever.
However, if I feed the UMat to these functions by simply substituting the `image` with `image.getUMat(cv::ACCESS_READ)` and let the code run for a while, I will get an Access Violation Exception at some point. Unfortunately, this is not reproducible, but the error is always at `cv::fastFree(void* ptr)`.

Here is the crash call stack:

- opencv_core320d.dll! cv::fastFree(void * ptr) Line 81
- opencv_core320d.dll! cv::StdMatAllocator::deallocate(cv::UMatData * u) Line 218
- opencv_core320d.dll! cv::MatAllocator::unmap(cv::UMatData * u) Line 63
- opencv_core320d.dll! cv::Mat::deallocate() Line 461
- cv::Mat::release() Line 705

Please note that neither the `ptr` fed into the `cv::fastFree` or `uimage.u` or `(uimage.u)->data` are NULL. All of them seem to point to legitimate memory locations.

##### Steps to reproduce

Unfortunately, this is not reproducible and I couldn't find any pattern when this happens. You have to let in run for a few hours and it will crash if you have used `getUMat` somewhere!
Repository: opencv
Issue: OCL_Arithm/Mul.Mat_Scale tests failing
Labels: category: ocl

##### System information (version)
```
CTEST_FULL_OUTPUT
OpenCV version: 3.3.0-dev
OpenCV VCS version: 3.3.0-rc-555-g9b178d7
Build type: release
Parallel framework: tbb
CPU features: mmx sse sse2 sse3
Intel(R) IPP optimization: enabled
Intel(R) IPP version: ippIP AVX2 (l9) 2017.0.3 (-) Jul 29 2017
OpenCL Platforms: 
    NVIDIA CUDA
        dGPU: GeForce GTX 1050 (OpenCL 1.2 CUDA)
Current OpenCL device: 
    Type = dGPU
    Name = GeForce GTX 1050
    Version = OpenCL 1.2 CUDA
    Driver version = 384.69
    Compute units = 5
    Max work group size = 1024
    Local memory size = 48 kB 
    Max memory allocation size = 1010 MB 288 kB 
    Double support = Yes
    Host unified memory = No
    Device extensions:
        cl_khr_global_int32_base_atomics
        cl_khr_global_int32_extended_atomics
        cl_khr_local_int32_base_atomics
        cl_khr_local_int32_extended_atomics
        cl_khr_fp64
        cl_khr_byte_addressable_store
        cl_khr_icd
        cl_khr_gl_sharing
        cl_nv_compiler_options
        cl_nv_device_attribute_query
        cl_nv_pragma_unroll
        cl_nv_copy_opts
        cl_nv_create_buffer
    Has AMD Blas = No
    Has AMD Fft = No
```

##### Detailed description
```
[  FAILED  ] 17 tests, listed below:
[  FAILED  ] hal_intrin.float32x4
[  FAILED  ] hal_intrin.float64x2
[  FAILED  ] Core_InputOutput.filestorage_keypoints_vec_vec_io
[  FAILED  ] Core_InputOutput.FileStorage_DMatch_vector
[  FAILED  ] Core_InputOutput.FileStorage_DMatch_vector_vector
[  FAILED  ] Core_InputOutput.FileStorage_KeyPoint_vector
[  FAILED  ] Core_InputOutput.FileStorage_KeyPoint_vector_vector
[  FAILED  ] Core_globbing.accuracy
[  FAILED  ] Core_Pow.special
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/40, where GetParam() = (CV_32F, Channels(1), false)
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/41, where GetParam() = (CV_32F, Channels(1), true)
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/42, where GetParam() = (CV_32F, Channels(2), false)
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/43, where GetParam() = (CV_32F, Channels(2), true)
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/44, where GetParam() = (CV_32F, Channels(3), false)
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/45, where GetParam() = (CV_32F, Channels(3), true)
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/46, where GetParam() = (CV_32F, Channels(4), false)
[  FAILED  ] OCL_Arithm/Mul.Mat_Scale/47, where GetParam() = (CV_32F, Channels(4), true)
```

# Other Info
As of today the build with cuda-9-RC with Nvidia-384 fails to load with python. import cv2 leads to segfaults. #9568 refers to this. I am unable to debug the segfault with python-gdb on linux as it just throws out a generic error: `ImportError: /home/whizzzkid/.opencv/lib/python2.7/dist-packages/cv2.so: undefined symbol: Py_InitModule4_64`

As of now, rebuilding without opencl, I am not sure if cuda will still work, let's see.
Repository: vscode
Issue: Implement privacy mode
Labels: feature-request

There should be a configurable privacy flag preventing Visual Studio Code from making any outbound connections similar to macOS firewall stealth mode. This would be useful to prevent someone with access to github operations data or an administrator of github accounts from tracking you.

Visual Studio Code immediately on launch makes various outbound tcp connections over https to Microsoft Corporation

Some Visual Studio Code out-of-the-box behavior has been seen to contact github every 3 minutes

- VSCode Version: 1.16.0
- OS Version: Linux
Repository: opencv
Issue: Multi-page TIFF reading with imreadmulti in python returning empty list?
Labels: category: python bindings,category: imgcodecs

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.3.0
- Operating System / Platform => Ubuntu 17.04
- Compiler => gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
-->

- OpenCV => 3.3.0
- Operating System / Platform => Ubuntu 17.04
- Compiler => gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
- Language => Python 3

##### Detailed description

Using imreadmulti in python seems to read the image, but returns an empty image list. Usage might be incorrect, I didn't find any working example for calling imreadmulti from Python

<!-- your description -->

##### Steps to reproduce

Run the attached python example
[imreadmulti_bug.zip](https://github.com/opencv/opencv/files/1308221/imreadmulti_bug.zip)

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->

Output is
```
True
0
[]
```

That should mean image was read correctly (True), but length is 0. Tiff file has 2 pages
Repository: angular
Issue: (AOT): ngc in watch mode starts compilation on every save from IDE
Labels: type: bug/fix,effort1: hours,freq2: medium,workaround2: non-obvious,area: compiler,state: confirmed,P4

<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.

ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
ngc in watch mode starts compilation on every save from IDE (Intellij Idea, autosave each 15 sec, autosave on window deactivation, manual save ctrl+s), but it does not mean that files were changed, content is the same, but ngc reports that file change was detected. It is not a problem in general, but even incremental recompilation takes quite much time.

## Expected behavior
ngc should try to minimize useless recompilations. webpack does it as well as tsc.


## Environment

<pre><code>
Angular version: 5.0.0-beta-7
<!-- Check whether this is still an issue in the most recent Angular version -->
 
For Tooling issues:
- Node version: 8.4.0
- Platform:  Windows
Repository: every-programmer-should-know
Issue: What are some good resources on Problem Solving?
Labels: Needs some ❤️
Repository: go
Issue: cmd/trace: go tool trace mishandles goroutine that extends beyond the current span.
Labels: help wanted,NeedsFix,compiler/runtime


Please answer these questions before submitting your issue. Thanks!

### What version of Go are you using (`go version`)?

% go version
go version devel +f351dbfa4d Thu Sep 14 04:49:58 2017 +0000 darwin/amd64

### Does this issue reproduce with the latest release?

yes

### What operating system and processor architecture are you using (`go env`)?

% uname -a
Darwin zapf.fritz.box 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

### What did you do?

Download the attached px.out trace
go tool trace px.out
Open the first span (0s-256.629789ms)

[px.out.zip](https://github.com/golang/go/files/1308813/px.out.zip)

### What did you expect to see?

The trace to terminate at 256ms with the G1 runtime.main goroutine constrained to the 256ms boundry.

### What did you see instead?

G1 runtime.main extends the length of the runtime of the program, 1.7s. Zooming into the trace G1 runtime.main does not appear to be valid, there are no breaks in the sequence and it doesn't seem to represent the real trace.

![screen shot 2017-09-17 at 13 33 04](https://user-images.githubusercontent.com/7171/30517784-f7efff32-9bac-11e7-96f1-3f5d0bc12ca1.png)
Repository: TypeScript
Issue: Can not specify toString/valueOf methods in object literal
Labels: Bug

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

**TypeScript Version:**  2.5.2

**Code**

```ts
interface X {
	name: string
}

const x1: X = {
	get name() { return 'x1' },
	toString() { return this.name },
//	^^^^^^^^
//	Type '{ readonly name: string; toString(): string; }' is not assignable to type 'X'.
//	Object literal may only specify known properties, and 'toString' does not exist in type 'X'.
}
const x2: X = {name: 'x2'}
x2.toString = function () { return this.name } // But add `toString` later is allowed.
```

**Expected behavior:**

Should allow object literal specify `toString`, `valueOf` and all properties exists on `Object.prototype`, or at least improve the error report to give a workaround (`const x: X & Object`).

**Actual behavior:**

See comments in code.
Repository: rust
Issue: Overflow evaluating the requirement error could be better for trivially recursive impls
Labels: C-enhancement,A-diagnostics,A-trait-system,T-compiler

[This overflow error could be better](https://play.rust-lang.org/?gist=5265161348870505c1b87db864f47e10&version=stable):

```rust
pub trait A {}
impl<T: A> A for T {}

pub trait B: A {}

struct C {}

impl B for C {}

fn main() {}
```

errors with:

```shell
error[E0275]: overflow evaluating the requirement `C: A`
 --> src/main.rs:8:6
  |
8 | impl B for C {}
  |      ^
  |
  = note: required by `B`

error: aborting due to previous error
```

which doesn't really point at the problem. The problem is that the `impl<T: A> A for T {}` is recursive.
Repository: neovim
Issue: hooks ("provider" interface) for find-file logic (:make %f, gf, ...)
Labels: enhancement,provider

This is just a usability enhancement suggestion, but perhaps consider not jumping to a non-existent file incorrectly parsed by `&errorformat` from the output of `:make`.

This is particularly handy if `makeprg` is set to some value with output not compatible with the default `errorformat` (and without a custom `errorformat` defined) that causes `%f` to evaluate to an incorrect value. Apart from improving the default `erroformat` where possible, I think internally disregarding the `%f` result if it points to a non-existent path is a fairly conservative "hack" that could greatly improve the user experience without adding too much magic or breaking compatibility.

Keeping in mind that is several order of magnitudes easier to specify a custom `makeprg` than it is to generate a proper custom `errorformat` for said `makeprg`, neovim users are bound to run into the case where their `makeprg` results in an incorrectly determined `%f` from whatever the current `errorformat` value is.

For instance, with `makeprg` set to `ninja` and attempting to build an invalid ninja build script, the default output of the tool is this (fairly standard, nothing surprising) error:

```
mqudsi@ZBook /m/c/U/M/g/wp-prism> ninja
ninja: error: build.ninja:20: expected '=', got lexing error
    sed "s/\$$prism_version = null;/\$$prism_version = \"$$(./prismversi...
        ^ near here
```

Unfortunately, the default `errorformat` parses this as an error in a file called `ninja: error: build.ninja` on line `20`, and pressing enter in response to the `Press ENTER or type command to continue` prompt causes the buffer to be replaced with an empty one (the result of loading the non-existent file specified).
Repository: rust
Issue: Cannot 'use' constant associated types.
Labels: A-associated-items,T-lang,C-feature-request

```
struct Foo{}

impl Foo {
    const BAR: usize = 0;

    fn useConst(&mut self) {
        use Foo::BAR;
        println!("{:?}", BAR);    // cannot use just BAR, must use Foo::BAR
    }
}
```

Basically you should be able to 'use' an associated constant so you don't have to fully qualified names. In the above case once extra word is no big deal. But imagine you need to have 20 constants and you use them 100 times.
Repository: go
Issue: x/tools/refactor/rename: does not rename example functions
Labels: Tools,Refactoring

Please answer these questions before submitting your issue. Thanks!


### What version of Go are you using (`go version`)?
go 1.9

### Does this issue reproduce with the latest release?
Yes

### What operating system and processor architecture are you using (`go env`)?


### What did you do?
https://play.golang.org/p/ibc3hWTjqN

Rename a function

### What did you expect to see?
https://play.golang.org/p/U0pdaBJT8j

gorename to rename the function, and to rename the example function, ExampleF.

gorename correctly renames the comment above documenting the function but does not rename the example function. After the rename, the example function is no longer visible in godoc

### What did you see instead?
https://play.golang.org/p/aSKw0KKxLH
Repository: neovim
Issue: netrw: "modifiable" errors after clicking away from insert mode
Labels: netrw

Under `NVIM v0.2.1-867-gd2cbc31`, the following causes errors about the buffer not being modifiable to show up:

```
nvim -u NORC
:vsp
:set mouse=a
#click in right pane
:Explore
#click in left pane
i
#click in right pane
#click in left pane
```

Expected: back in left pane in insert mode
Actual: error about modifiable being off, in insert mode, in right pane