sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Feature: Composing spread operator on Union types and static_key function to enable generic capability
Labels: Suggestion,Needs Proposal

Related issues: #13542 #15759 (slightly different take and example on closed issues)

I originally posted on issue #15759 but decided that they were different enough to be looked at separately and that issue doesn't address a generic capability. Look back at https://github.com/Microsoft/TypeScript/issues/15759#issuecomment-314157616 for clunky workaround examples.

**Proposal**

1.  Add spread operator `...` to string literal union types acting as an string array or generator. Type `T` applying spread operator will result in type `T[]`. For example:

```
type Group = 'red' | 'blue' | 'green';
const groups = ...Group; // groups has type of Group[] with values ['red', 'green', 'blue']
```

2. Add static function `static_key` or `keyof` that transforms a static interface to a string literal union of all combined types. For example:

```
interface Groups<T, U, V> {
  red: T;
  green: U;
  blue: V;
}
type groups = static_key(Groups); // 'red' | 'blue' | 'green'
```

3. Composing both can result in powerful generic operations. I feel that this could bring a unique capability that string enums could not and may have been overlooked. It would be very powerful for a `Record` type or interface where all fields are the same type. Here is an example:

```
interface GroupDescription {
    name: string;
    description: string;
}

type Group = 'red' | 'blue' | 'green';
type Groups = { [K in Group]: GroupDescription };

function initGroups(groups: Groups) {
    for(const group of ...static_key(Groups)) { // group would be type Group or 'red' | 'blue' | 'green'
        processGroup(name); //Generically Process property
    }
}

function processGroup(group: Group) { }
```

I noticed I don't need `...static_key` but instead directly use the spread operator on the union type `...Group`. The point is that they compose well together and they add generic capability.
Repository: go
Issue: sync: add examples for Map
Labels: Documentation,help wanted,NeedsFix,compiler/runtime

It would be nice if there were usage examples for sync.Map, but there are not currently any.

- Can keys be ordinary values like strings, or should they be custom types, a la context.WithValue?
- Should I always store a pointer to a value, or can I store a value like a string? If the former how should I do it?
Repository: create-react-app
Issue: Enabling 2-way PKI authentication
Labels: issue: proposal

I need 2-way authentication to be configurable because my company requires all internal webapps to use it.

The proposal is three-fold. I want the following to be configurable:
* Configure the webapp to request the client's certificate,
* Once the webapp receives the certificate pass information about the cert to the expressjs server,
* Make the webapps' certificate and key configurable.

Background on this:
* Two-way authentication involves the browser/client sending a user's certificate to the back-end. 
  * Passport, for example, has a strategy for this: https://github.com/ripjar/passport-client-cert
* In proxying environments, it's acceptable for the webapp/frontend to send certificate attributes to the backend
  * This was discussed here, #1413, which provides some useful links:
  * http://www.zeitoun.net/articles/client-certificate-x509-authentication-behind-reverse-proxy/start
  * https://serverfault.com/questions/622855/nginx-proxy-to-back-end-with-ssl-client-certificate-authentication
  * https://lists.gt.net/apache/users/350827

Without the above I can't easily test my passport setup and can't easily test my custom authentication code until I build for production.

My open questions are:
* Is there any way to customize the webapp's configuration? It appears to me we have to rely on create-react-app to do it for us.
* My understanding from #1413 is that WDS will also need modifications in order for the webapp to pass cert attributes to the backend. I'll need to raise an issue for that over at WDS. Is this correct?
Repository: electron
Issue: Feature request: Access to "user gesture" flag, especially in 'new-window' event
Labels: enhancement :sparkles:

Knowing whether the user initiated the `new-window` event is important for blocking unwanted popups in a webview. Without it, an untrusted page can call `window.open()` or `anchorTag.click()` to trigger popups at will.

In `webContents.executeJavascript`, we have a `userGesture` parameter which overrides the flag indicating whether the user triggered an event.

Is it possible for the application to get access to the state of that flag via a function call - something like `webContents.hasUserGesture()`? If not, could we get access to it in the `new-window` event via an attribute, `event.hasUserGesture` ?

(I can make a PR if somebody can assure me this is doable, and point to relevant APIs.)
Repository: rust
Issue: `cannot move out of borrowed content` error is bad when self is borrowed
Labels: C-enhancement,A-diagnostics,A-borrow-checker,T-compiler

E.g., consider a struct with a field `build_queue` which is owned. In a `&self` function I call `request_build` which takes `self` by value. I get the error:

```
error[E0507]: cannot move out of borrowed content
   --> src/actions/mod.rs:151:9
    |
151 |         self.build_queue.request_build(project_path, priority, move |result| {
    |         ^^^^ cannot move out of borrowed content
```

This is not very useful since it does not indicate why a move is happening and the squiggle is indicating the wrong thing. I think the squiggle should be under `self.build_queue` rather than just `self` and that there should be a note referring to the definition of `request_build` and indicating the by-value `self` which causes the move.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

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

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: go
Issue: x/net/http2: connecting to non-compliant HTTP2 server returns Client.Timeout exceeded; fallback to HTTP/1?
Labels: NeedsFix

### What version of Go are you using (`go version`)?

```
go version go1.8.3 darwin/amd64
```

### What operating system and processor architecture are you using (`go env`)?

```
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tkng"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/z1/nc5xfnrs71g2zxr_chmshx3h0000gp/T/go-build993898931=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
```

### What did you do?

Following snippet code should be enough to reproduce the problem.

https://play.golang.org/p/PmZWp6NJlq

If I disabled HTTP2 by the environment variable `GODEBUG=http2client=0`, then I see no error. Hence I guess this issue is related to HTTP2. This is might be the same as #13959, but I'm not sure.

Also, I'm not sure this is the problem of golang's HTTP2 client library, or the problem of server side. (In most case, HTTP2 client works nicely.)

### What did you expect to see?

I can connect to the server (by http2, or falling back to http1.1). At least, I want to see a more suggestive error message.

### What did you see instead?

I saw an error message like following:

```
2017/07/11 15:22:01 http.Get failed, error: Get https://precious.jp: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
```
Repository: rust
Issue: Add syntax highlighting for TOML to rustdoc
Labels: T-rustdoc,C-feature-request

Since TOML is such an essential part of the Rust ecosystem, it’s probably worth adding syntax highlighting for this file format. [Here](https://docs.rs/futures/0.1.14/futures/#installation) is an example of a code block that is currently ignored, syntax-highlighting-wise, when generating the documentation.
Repository: rust
Issue: Improve error message on namespace collision
Labels: C-enhancement,A-diagnostics,T-compiler,D-papercut

```rust
struct Model;

fn model(model: Model) -> Model {
    model
}

fn main() {
    let mut model = Model;
    model = model(model);
}
```

The error message is:

```
error: expected function, found `Model`
 --> <anon>:9:13
  |
9 |     model = model(model);
  |             ^^^^^^^^^^^^
  |
note: defined here
 --> <anon>:8:9
  |
8 |     let mut model = Model;
  |         ^^^^^^^^^

error: aborting due to previous error
```

I guess, the compiler should suggest you to avoid using the same names for functions and variables.
Repository: TypeScript
Issue: Mixed es5/es2015 code with mixin classes causes runtime errors
Labels: Suggestion,Help Wanted,Effort: Moderate,Awaiting More Feedback

**TypeScript Version:**  2.4.1 (but likely anything since 2.2)

When utilising code targeted at ES5 mixed with code targeted at ES6 causes a [runtime error when using mixin classes](https://jsfiddle.net/kitsonk/pn2f3ad0/).  The real world use case was using a library that was targeted at ES5 for distribution compatibility reasons while downstream code is being targeted at ES2017 because of running in a known limited environment.

**Code**

*Tagged.ts*

```ts
// @target: es5
export interface Constructor<T> {
    new(...args: any[]): T;
    prototype: T;
}

export default function Tagged<T extends Constructor<{}>>(Base: T) {
    return class extends Base {
        _tag = '';
    }
}
```

*TaggedExample.ts*

```ts
// @target: es2015
import Tagged from './Tagged';

class Example {
  log() {
    console.log('Hello World!');
  }
}

const TaggedExample = Tagged(Example);

const taggedExample = new TaggedExample(); // Uncaught TypeError: Class constructor Example cannot be invoked without 'new'
```

**Expected behavior:**

No run-time errors.

**Actual behavior:**

A runtime error of `Uncaught TypeError: Class constructor Example cannot be invoked without 'new'`.
Repository: react
Issue: Remove unstable_renderIntoContainer
Labels: Type: Discussion,Component: Reconciler,Type: Breaking Change,React Core Team

My hunch is we want to remove it before 16 because `unstable_createPortal` accomplishes the same thing. I remember `unstable_renderIntoContainer` adding a bunch of complexity that would be nice to get rid of before committing to support it for another release cycle.
Repository: flutter
Issue: Document the extended layer cake
Labels: team,framework,a: accessibility,d: api docs,P3,team-framework,triaged-framework

See https://github.com/flutter/flutter/pull/11135#discussion_r126579601
Repository: go
Issue: cmd/link: support msvc object files
Labels: OS-Windows,Builders,NeedsInvestigation,FeatureRequest,compiler/runtime

I understand that the go linker cannot currently link msvc object files and also recognize that this issue is likely to be a low priority. However, it would be nice to support this because it would somewhat simplify windows workflow. This issue is mainly to understand how much effort this would be and/or what would be required.
Repository: vscode
Issue: Autoindent inserts extra undo item, requires double undo after paste
Labels: editor-autoindent,under-discussion,undo-redo

- VSCode Version: 1.14
- OS Version: macOS 10.12.5

Here's an example of pasting something, then hitting cmd-Z to undo. As you can see, it first undoes one indentation, then undoes the paste. That's not right, since my paste was a single command, so a single undo should undo it.

![vsc](https://user-images.githubusercontent.com/50314/28082497-eee3dfe0-6672-11e7-998a-8715249ec60b.gif)

Steps to Reproduce:

1. Copy something.
2. Go into a block that has a deeper indentation level.
3. Hit cmd-V.
4. Hit cmd-Z.
5. The paste remains, but one indent level is subtracted.

Reproduces without extensions: Yes
Repository: rust
Issue: Unclear error note due to use of underscores when unifying paremeters to a single generic type
Labels: C-enhancement,A-diagnostics,T-compiler,D-papercut

[Playground link](https://is.gd/sMns3l)

When I compile the following code:

```
fn test<T>(x: (T, Vec<T>)) {}

fn main() {
    let param = ("hi", vec!(1, 2));
    test(param);
}
```

I get the following error message:

```
rustc 1.18.0 (03fc9d622 2017-06-06)
error[E0308]: mismatched types
 --> <anon>:5:10
  |
5 |     test(param);
  |          ^^^^^ expected &str, found integral variable
  |
  = note: expected type `(_, std::vec::Vec<_>)`
             found type `(&str, std::vec::Vec<{integer}>)`
```

It is unclear that the types in the note aren't matching. `(_, std::vec::Vec<_>)` seems like it should correspond to `(T, std::vec::Vec<S>)`, which would unify with `(&str, std::vec::Vec<{integer}>)` just fine. The overall error message does not provide the desired context to fix the problem, and requires that you look up what the specific types represented by the underscores are to understand why it is failing to typecheck.
Repository: TypeScript
Issue: Add capability of transforming and emitting JSDoc comments
Labels: Suggestion,In Discussion,API

So I am trying to create a new documentation generator for TypeScript together with @BurtHarris. Currently it does not do much; I've been mainly tinkering a bit with the compiler API to see what it is capable of. You will be able to find it [here](https://github.com/TypeForce/tsdoc) when it's finished.

One of the things we thought about was the ability to 'target' JSDoc comments using the type information provided by TypeScript. I've been investigating how to tackle the issue. Ideally, it would use the transformers the compiler API has to offer but of all the functions provided in `factory.ts`, the ones that came closest were `addSyntheticLeadingComment`, `setSyntheticLeadingComments`, `setSyntheticTrailingComments` and `addSyntheticTrailingComment`; none of which provide the means to create complete synthetic JSDoc tags and comments.

So with this issue I'm actually asking the status-quo of this feature. Is it still possible to get this on the [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap)? If so, can I help? If not, is there a possibility of a patch that makes it possible to implement this as a third-party module?

### Related issues

 - [Generate doc comments in emitted JS](https://github.com/Microsoft/TypeScript/issues/10)
 - [Cannot add or modify JSDoc with custom transformers](https://github.com/Microsoft/TypeScript/issues/15639)
 - [Expose public API for transformation](https://github.com/Microsoft/TypeScript/pull/13940)
 - [Replace emitter with syntax tree transformations and a simplified node emitter](https://github.com/Microsoft/TypeScript/issues/5595)

### Previous attempts

 - [spatools/ts2jsdoc](https://github.com/spatools/ts2jsdoc)
 - [develar/ts2jsdoc](https://github.com/develar/ts2jsdoc)
Repository: TypeScript
Issue: improve docs of compiler APIs
Labels: Docs

hi,

i'm trying to implement an instrumenter on top of typescript compiler APIs.
i cannot find a "real" documentation beside of this [wiki page](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API) but i think that it should be upgraded from a single wiki page to a dedicated section with examples for:
- creating new nodes (e.g. create a brand new statement and attach it to an existing function body)
- updating existing nodes (e.g. patching a statement)
- add types declarations (e.g. add arbitrary types to a function declaration)
- _todo..._

what do you think about this?

EDIT: i've found this [nice article](http://blog.scottlogic.com/2017/05/02/typescript-compiler-api-revisited.html) that shows some really useful code.
EDIT: i've found this [nice project](https://github.com/dsherret/ts-simple-ast) that can help to understand how to use the compiler apis for more advanced use cases.
Repository: TypeScript
Issue: Add plugins property on TS Server open request
Labels: Bug,VS Code Tracked,Domain: TSServer

## Problem
VSCode allows TSServer plugin extensions to register themselves for language modes besides javascript and typescript. The angular extension for example can register the angular TSServer plugin for the `ng-html` language. When an `ng-html` file is sent to TS and the angular plugin is not active, Typescript will treat the file contents as typescript code, resulting in a number of syntax errors

## Proposal
Add an optional `plugins` property on TSServer `open` requests.

```ts
interface OpenRequestArgs {
    ...,
    plugins?: string[]
}
```

`plugins` would be a list of tsserver plugin package identifiers.

On the TypeScript side, the new logic for handling the `plugins` property on `open` requests would look something like:

* If `plugins` is undefined, the `open` request behaves the same as it does currently.
* If `plugins`  is an array, TypeScript checks to see if any of the plugins it has loaded are in the `plugins`.
    * When no match is found, the opened file is ignored by the TSServer
    * If a match is found, the opened file is handled by TypeScript. The plugin would be responsible for disabling the standard TS features in the file

## Open Questions
**What does ignoring a file mean?**
What happens when `plugins` is provided but no match is found against the loaded plugins on the TSServer? Two options I see:

1. TS keeps the file open and VSCode continues sending update events about it, but TS never actually generate any events or fufills any requests against it.

2. TS tells VSCode that it doesn't care about this file, perhaps by returning an error from `open` VSCode would no longer send sync events about the file or send TS requests about it

**scriptKindName**
`OpenRequestArgs` includes an optional field  `scriptKindName?: ScriptKindName`.

```ts
type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
```

Should a new kind for external files be added?

```ts
type ScriptKindName = "TS" | "JS" | "TSX" | "JSX" | "EXTERNAL";
```
Repository: opencv
Issue: Unable to use detected keypoints by FastFeatureDetector to compute with ORB (CUDA version)
Labels: bug,category: features2d,category: gpu/cuda (contrib)

##### System information (version)

- OpenCV => Latest
- Operating System / Platform => Ubuntu 16.04
- Compiler => GCC 5.4

##### Detailed description

I am unable to use the detected keypoints found by FastFeatureDetector to compute the descriptors with ORB when using the CUDA API. I was able to do this successfully withe CPU version.

##### Steps to reproduce

``````
cv::Mat img_cpu = cv::imread("test.png", cv::IMREAD_GRAYSCALE);

cv::cuda::GpuMat img;

img.upload(img_cpu);

cv::Ptr<cv::cuda::ORB> orb =
      cv::cuda::ORB::create(5000, 1.2f, 8, 31, 0, 2, 1, 31, 10, true);

cv::Ptr<cv::cuda::FastFeatureDetector> fast =
      cv::cuda::FastFeatureDetector::create(100, true, 2);

cv::cuda::GpuMat keypointsGPU;
cv::cuda::GpuMat descriptorsGPU;

// this works
orb->detectAsync(img, keypointsGPU);

// but this causes segmentation fault, the same approach works without a problem in cpu 
// fast->detectAsync(img, keypointsGPU);

orb->computeAsync(img, keypointsGPU, descriptorsGPU);
``````
Repository: vue-element-admin
Issue: 开启Vuex的严格模式会报错
Labels: bug,enhancement :star:

开启严格模式会控制台报两个错，一直不知道怎么调试定位具体问题；
另外，store的app在对visitedViews进行push时，也报错，好像是堆栈溢出。
const store = new Vuex.Store({
  **strict:true,**
  modules: {
    app,
    user,
    permission
  },
  getters
});


![snap](https://user-images.githubusercontent.com/4743467/28155434-50d739e4-67e1-11e7-806c-2ad7ef7722ab.png)
Repository: opencv
Issue: Some classes which are missing in the Java wrapper
Labels: feature,category: java bindings

<!--
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.3.0-rc
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2017

##### Detailed description
The classes that are missing in the Java wrapper are as below:

1. **SimpleBlobDetector** and **KeyPointsFilter** classes are missing in feature2d module.
2. **LDA** (Linear Discriminant Analysis) and **SVD** (Singular Value Decomposition) classes are missing in core module
3. The **UMat** object is also missing in the Java wrapper.

_Note: The above-missed classes are what I have found till now, maybe there are more APIs which are missing in the Java wrapper. There are a lot of projects which we needed for these APIs._

**And also** if it is possible please add the documentation for the API in the Java wrapper which can help to learn and see the parameters, methods and classes description inside the IDE instead of going to OpenCV home page and search for some description of the functions are the parameters.

Big Thanks to OpenCV Team!!!
Repository: opencv
Issue: weighted centroid  in phase Correlation is a reason for wrong result 
Labels: feature,category: imgproc

I know that this sound like asking for a feature but it is not 
it is about applying the weighted centroid as a last step in phaseCorrelate , i guess it was meant for getting sub pixel accuracy and it usually work but in my case it was a reason for wrong result 
the ground truth in my case was a shift of ~ 0.5 pixel so i was expecting something between 0 and 1 but i was getting 8 
with some debugging i found out that **the maximum peak location was actually 1 ("as it suppose to be ") but when applying the weighted weightedCentroid i got the (8)** 

i think the reason for that is having **negative values in the Cross-correlation matrix where  weighted centroid does not make sense any more** 

i suggest as a small fix to add a parameter to give the option of not using the weighted centroid  and returning the peak location , and again this not about extra feature , it is about a code that is causing wrong result 

Best Regards 
Sabaa