sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Cannot infer type in test from section 12.4 of rust book v2
Labels: C-enhancement,A-diagnostics,T-compiler,A-inference,D-newcomer-roadblock

Hello everyone!
I'm learning Rust now using [this book](https://doc.rust-lang.org/book/second-edition/) and faced strange(as for me) error on section 12.4 when running tests.

[You can reproduce a bug with next snippet of code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=908e4dd2100ae4b4df7f85e5dc405cc5)

```
pub fn search<'a> (q: &str, text: &'a str) -> Vec<&'a str> {
    text.lines().filter(|line| line.contains(q)).collect()
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn it_should_compile_but_it_doesnt () {
        let q = "queryABCD";
        let t = "text with query";
        assert_eq!( vec![], search(q, t) );
    }
}

// error[E0282]: type annotations needed
//   --> src/lib.rs:13:21
//    |
// 13 |         assert_eq!( vec![], search(q, t) );
//    |                     ^^^^^^ cannot infer type for `T`
//    |
//    = note: this error originates in a macro outside of the current crate
```

However, it's fairly obvious that compiler knows the type annotation that must be infered from vec![] macro. Next snippet makes it clear

```
pub fn search<'a> (q: &str, text: &'a str) -> Vec<&'a str> {
    text.lines().filter(|line| line.contains(q)).collect()
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn it_should_compile_but_it_doesnt () {
        let q = "queryABCD";
        let t = "text with query";
        assert_eq!( 333, search(q, t) );
    }
}

// error[E0277]: the trait bound `{integer}: std::cmp::PartialEq<std::vec::Vec<&str>>` is not satisfied
//   --> src/lib.rs:13:9
//    |
// 13 |         assert_eq!( 333, search(q, t) );
//    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't compare `{integer}` with `std::vec::Vec<&str>`
//    |
//    = help: the trait `std::cmp::PartialEq<std::vec::Vec<&str>>` is not implemented for `{integer}`
//    = note: this error originates in a macro outside of the current crate
```

I think it's a bug but not sure since I'm novice in rust. I tried different toolchains, specifically 1.16, 1.18, 1.20(stable) and nightly and got the same result.
Repository: TypeScript
Issue: Declaration merging: remove function overloads?
Labels: Suggestion,Awaiting More Feedback

Let's say one of the libs come with a function like this:

```ts
// library:
declare module 'example' {
    interface Animal { }
    export function sayHello(a: Animal);
}
```

I want to narrow down the type to just `Dog`. This is my module augmentation:

```ts
// app.ts
declare module 'example' {
    interface Dog extends Animal { }
    export function sayHello(a: Dog);
}
```

This merges the declarations to two function overloads:

```
sayHello(a: Dog);
sayHello(a: Animal);
```

I'd like to remove the generic `Animal` one to get stricter type checking of my code.

I couldn't find if this has been discussed before but I would find it useful quite often. Some examples would be:

- `express` headers (string by default, I'd use union of string literals)
- `yargs` args (I'd limit them to args specific to my app)
Repository: opencv
Issue: OpenCL native_sqrt precision 
Labels: category: imgproc,category: ocl

##### System information (version)
- OpenCV => 3.3.0-dev
- Internal OpenCL 1.2 implementation.

##### Detailed description

In OpenCL the accuracy of builtin functions with the `native_` prefix  is implementation defined.
The improc corner.cl file is using `native_sqrt` in two places, line [219](https://github.com/opencv/opencv/blob/master/modules/imgproc/src/opencl/corner.cl#L219) & [211](https://github.com/opencv/opencv/blob/master/modules/imgproc/src/opencl/corner.cl#L211). 

Because of this I'm seeing fails with an internal OpenCL implementation of the OCL_Imgproc/CornerMinEigenVal.Mat subtests in the opencv_test_imgproc unit tests due to not precise enough results. Changing native_sqrt to sqrt resolves this issue.

If there is a hard precision requirement here we shouldn't be using native builtins as it's not portable.
Repository: godot
Issue: GridMap Enhancement: Make use of Bresenham's line algorithm for drawing
Labels: enhancement,topic:editor,usability

In pixel art applications, it is common to use a line algorithm draw a line between the last two sampled  input points. For example, if I move my mouse too fast for godot to handle on my PC, I get a handful of discrete tile placements. Using Bresenham's line algorithm, these would instead be solid lines of tiles.

This was drawn with a single left-click and quick drag:
![image](https://user-images.githubusercontent.com/1318345/31387053-bd295b4e-ae14-11e7-949a-c775771087fa.png)

But it really should be something like this instead:
![image](https://user-images.githubusercontent.com/1318345/31387080-d54f5d36-ae14-11e7-8be0-525d5f18d741.png)

This is a common feature of raster based drawing applications, and I believe most voxel packages also.
 (at least MagicaVoxel and Qubicle). It would vastly improve the usability and general "feel" of the GridMap editor

Algorithm for reference: https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
Repository: rust
Issue: link-dead-code does not include symbols for unused inlined functions
Labels: C-enhancement,A-codegen,T-compiler

Consider a file `x.rs`:

```rust
#[inline]
fn gggg() {}
fn main() {}
```

The symbol `gggg` is not included in the compiled binary (tested with `rustc -C link-dead-code x.rs && nm x | grep gggg`). If the inline attribute is removed, the symbol is included.
Repository: flutter
Issue: Stepper should change height with textScaleFactor
Labels: framework,f: material design,a: accessibility,a: fidelity,c: proposal,P2,team-design,triaged-design

When a the textScaleFactor changes, the step names will scale, and so the height of the steps should change.
Repository: vscode
Issue: [folding] allow defining folding regions in user settings and/or extensions
Labels: feature-request,editor-folding

Would it be able to abstract out the language specifics and treat code folding similar to how `emmet` handles it...
i.e.
```
    "emmet.includeLanguages": {
        "php": "html",
        "blade": "html",
        "javascript": "javascriptreact"
    },
```
So for code folding it could be...
```
    "codeFolding.IncludeLanguages": {
        "php": {
            "openTag": "//#region",
            "closeTage": "//#endregion"
        },
        ...etc...
    }
```

This is just an off the cuff idea for implementing this and I'm not sure that it's possible, but the goal would be to not be dependent on the language plugin developers to implement the feature.
Repository: flutter
Issue: Document how to create bullet list and numbering list using RichText Widget  with indent and outdent
Labels: framework,d: api docs,a: typography,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

Is there a way to add bullet list or numbering list in the RichText widget? How about indent and outdent?

Thanks.
Repository: go
Issue: crypto/elliptic: ECDSA parameters should be validated.
Labels: help wanted,NeedsFix

### What version of Go are you using (`go version`)?
`go1.9.1 linux/amd64`

### What operating system and processor architecture are you using (`go env`)?
GOHOSTARCH="amd64" (intel)
GOHOSTOS="linux"

### What did you do?
Playground link:
https://play.golang.org/p/Ldd8fvrP5m

I've been playing around with Go's ECDSA package and have noticed a few problems, none of practical security relevance, since those problems have premises unlikely to happen in real use cases. (I actually discussed those on Go's security mailing list a long time ago.)

The problems are all about parameters validation in ECDSA.

### What did you expect to see?
The Go's implementation should conform to the [DSS standard](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf), notably by performing verification that the point used are actually on the curve at hand.
But if the checks I discuss here are considered not worthy, a workaround like what has been done for DSA might be good to completely avoid any risk of infinite loops.

I would expect a method to check the validity of the provided parameters, as per [FIPS 186-4](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf) sections [3.1](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf#page=20) and [3.3](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf#page=22).

### What did you see instead?

- No check is performed on the curve's points used to see whether they are on the curve or not, so it is possible to use a point not even on the curve. (Whether this is dangerous for ECDSA has not been studied.)  
Note that checks that points are on the curve are performed in the TLS package (where they are important, because of the invalid curve attack) thanks to the [elliptic.Unmarshal](https://golang.org/pkg/crypto/elliptic/#Unmarshal) method.

- I also see that no check is performed on the private parameter "d" to verify if it's within well defined bounds. So it is possible to sign using a 0 value, which is not among the correct boundaries which are [1, n-1] (even if the value 1 does not make much sense from a security point of view).   
There is an example on the playground linked where this causes an infinite loop when signing an null hash with a null private integer.    
The value 0 is simply invalid as a private integer and should be rejected.

- There are no "validation" methods for keys, this could be a good way to avoid performing such checks at each signature/verification: by providing a method users are supposed to use to validate the keys.

Such checks are important in my opinion and are part of the so-called "defense in depth" we want to generally ensure in a crypto library.

What are your opinions on these topics?
Repository: godot
Issue: SpotLights with shadows enabled cause artifacts to appear in the editor (`3.x` only)
Labels: bug,topic:rendering,confirmed,topic:3d

**Operating system or device, Godot version, GPU Model and driver (if graphics related):** Windows 10, Godot Git https://github.com/godotengine/godot/commit/409e58e67abde4e7af6e43b32c23338e119377fb, NVIDIA

SpotLights with shadows enabled cause shading artifacts to appear in the editor, see the screenshots below. Tweaking the shadow bias doesn't seem to have any effect on the artifacts.

**Narrow spotlight with shadows (broken):**

![Narrow spotlight with shadows (broken)](https://user-images.githubusercontent.com/180032/31450125-f77b25ae-aea8-11e7-992f-687222416c8b.png)

**Wide spotlight with shadows (broken):**

![Wide spotlight with shadows (broken)](https://user-images.githubusercontent.com/180032/31450130-f84363c0-aea8-11e7-8169-f47ed55b0252.png)

SpotLights with an angle above 90° look broken with shadows enabled, but they work with shadows disabled.

**Ultrawide spotlight with shadows (broken):**

![Ultrawide spotlight with shadows (broken)](https://user-images.githubusercontent.com/180032/31450126-f79a7440-aea8-11e7-957f-7bb05904201c.png)

**Ultrawide spotlight without shadows (working):**

![Ultrawide spotlight without shadows (working)](https://user-images.githubusercontent.com/180032/31450127-f7b6cac8-aea8-11e7-80a2-7e6002327842.png)

This bug doesn't seem to affect running projects.

**SpotLight in running project (working):**

![Spotlight in running project](https://user-images.githubusercontent.com/180032/31450124-f75da47a-aea8-11e7-9a6c-31f29a866e64.png)
Repository: angular
Issue: Overriding 'panmove' Hammer event for multitouch does not work  
Labels: type: bug/fix,freq1: low,area: core,core: event listeners,P3

## 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. -->
When extending HammerGestureConfig, overriding 'panmove' event with a 'pointers' parameter higher than 1 does not work. 2+ fingers moves for 'panmove' are not regnonized and do not trigger any events. I want to inform that I had no issue overriding other parameters for other events.

## Expected behavior
When setting 'pointers' parameter at 2 for 'panmove' event, application shall trigger 'panmove' event when panning with 2 fingers .

## Minimal reproduction of the problem with instructions
Here is an example to test on a touchscreen:
http://plnkr.co/edit/c9yfRNag7TqSKmX8QMww?p=preview

## What is the motivation / use case for changing the behavior?
User want to be able to pan over a touchscreen with more than one finger.

## Environment

<pre><code>
Angular version: 4.3.0
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  <!-- run `node --version` -->
- Platform:  <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->
Using Chrome on a tablet (Windows or Android). 
</code></pre>
Repository: rust
Issue: make easier/possible to detect `derive` attributes after expansion
Labels: A-macros,T-compiler,C-feature-request

In the spirit of #44942, it would be nice if the `missing_debug_implementations` and `missing_copy_implementations` lints suggested adding a derive attribute (in the case where one does not already exist) or adding `Debug` (respectively `Copy`) to the list of traits in the derive attribute (in the case where it already exists). (This mostly for the sake of RLS and [other tools](https://github.com/killercup/rustfix), but the span highlighting is pretty, too.) But while the lints (obviously, necessarily) know how to look up whether the trait has been implemented, it's not clear how to make them detect an existing derive attribute (and its span): `cx.tcx.get_attrs` doesn't work because we apparently strip off the attribute during expansion ~~(it _looks_ like this happens twice, which is confusing: [1](https://github.com/rust-lang/rust/blob/c0d40a190/src/libsyntax/ext/expand.rs#L310-L311) [2](https://github.com/rust-lang/rust/blob/cbf5d39cca/src/libsyntax/ext/derive.rs#L25-L27))~~. But I can't modify the expansion code because I'm still not smart enough to understand it.
Repository: TypeScript
Issue: require.main.require imports do not work
Labels: Suggestion,Awaiting More Feedback,VS Code Tracked,Domain: JavaScript

<!-- 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 -->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  2.6.0-dev.201xxxxx

From: https://github.com/Microsoft/vscode/issues/35489#issuecomment-335689358

**Code**

```ts
const myModule = require.main.require('./file.js')
```

Run go to definition on `myModule`

**Expected behavior:**
Goes to defintion of `myModule` 

**Actual behavior:**
Nothing happens. Looks like we don't understand `require.main.require` style imports
Repository: kubernetes
Issue: CRI: clarify optional fields in all structures
Labels: kind/cleanup,sig/node,lifecycle/frozen,triage/needs-information

Towards https://github.com/kubernetes-incubator/cri-tools/issues/151 and https://github.com/kubernetes-incubator/cri-tools/pull/152, we need to clarify the optional fields for all structures in CRI.
Repository: angular
Issue: [Proposal] medatdata / extras property for AbstractControl
Labels: feature,state: Needs Design,area: forms,feature: under consideration

## I'm submitting a...
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[x] 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
Currently there is no way to construct FormControl, FormGroup and FormArray and set metadata / extras info (ex. allowedValues etc.)


## Expected behavior
Possibility to set metadata / extras info


## What is the motivation / use case for changing the behavior?
Possibility to set metadata info for each specific control would be very helpful when writing forms. For example generating select options would looks like that:

```html
<label for="control1">Control 1</label>
<select id="control1" [formControl]="control1">
  <option *ngFor="let option of control.metadata.allowedValues" [ngValue]="option">
    {{option.someProp}}
  </option>
</select>

<label for="control2">Control 2</label>
<select id="control2" [formControl]="control2">
  <option *ngFor="let option of control.metadata.allowedValues" [ngValue]="option">
    {{option.someProp}}
  </option>
</select>
```

Or if you have a form which is table but not all cells are controls, let say in each row you have cell with id (it is not a control just value for the user):
```html
<table>
  <thead>
  <tr>
    <th>...</th>
    <th>...</th>
    <th>...</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let control of controls"
      [formGroup]="control"
      [attr.id]="control.metadata.id">

    <td>{{control.metadata.id}}</td>
    <td><input formControlName="child1"></td>
    <td><input formControlName="child2"></td>
  </tr>
  </tbody>
</table>
```
And there may be many more usage examples


## Proposal API
Setting this new property should be possible by using `FormBuilder`, `FormControl`, `FormGroup` and `FormArray`:
 * for `FormBuilder#group` pass as optional property in `extra` arg
 * for `FormBuilder#array`, `FormGroup` and `FormArray` pass as 4th optional arg
 * for `FormBuilder#control` and `FormControl` pass as optional property in `formState` arg

Example:
```typescript
formBuilder.group({
  child1: {
    value: null, 
    metadata: { allowedValues: ['A', 'B', 'C'] }
  },
  child2: ''
  array: formBuilder.array([], null, null, {category: 'CUSTOMER_1'})
}, {
  metadata: { id: 1253 }
})
```
Repository: opencv
Issue: about icvGetQuadrangleHypotheses function skip holes
Labels: category: calib3d,RFC

in icvGetQuadrangleHypotheses function, 

there are following code:

        if (hierarchy.at(idx)[3] != -1)
            continue; // skip holes

but does it right?, how about change it like the following?

        if (hierarchy.at(idx)[2] != -1)
            continue; // skip holes

I can not figure out which is right? 

https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=findcontours#findcontours
Repository: You-Dont-Know-JS
Issue: Up & Running Ch2 Transpiling - use of (void 0) and confusing paragraph
Labels: for second edition

In the example foo() function it's not clear why (void 0) was used when it appears "undefined" could be used with the same effect (at least that's what I've seen). "void" was very briefly mentioned earlier in the book but wasn't fully explained.

Re the paragraph: 

"You may not have realized just from looking at the ES6 version that undefined is the only value that can't get explicitly passed in for a default-value parameter, but the transpiled code makes that much more clear."

This part: "can't get explicitly passed in for a default-value parameter" seems to be a contradiction, or at least ambiguous, is it:

1. undefined can't be passed into a function as an argumentr? (it can)
2. undefined can't be passed into a function that uses default parameter values? (it can)
3. undefined can't be written into a parameter as a default value? (it can)

Does it mean, in effect: "You can pass in "undefined" as an argument to a function, but if that function has a default parameter value that value will override undefined"?
Repository: TypeScript
Issue: Support @ts-ignore for specific errors
Labels: Suggestion,Revisit

**TypeScript Version:**  2.6.0-dev.20171011

**Code**

```ts
function countDown(n: number): void {
    switch (n) {
        // @ts-ignore
        case 1:
            console.log("1");
            // intentional fall through
        case 0:
            console.log("0");
    }
}
```

**Expected behavior:**

Ability to make `ts-ignore` apply to the `--noFallthroughCasesInSwitch` error but not to other errors.

**Actual behavior:**

`case "1":` would also compile.
Repository: TypeScript
Issue: JSDoc-typed node modules require special configuration in consumers to be useful
Labels: Suggestion,Needs Proposal

It looks like an ongoing goal for TS is to recommend JSDoc as the recommended way to give type-checking to raw JS users. As a user I am not a huge fan of this approach but I'll try to be objective in this issue.

If I write a node module `js-lib` as raw javascript typed with jsdoc, it will appear as untyped to consumers of my module unless they specifically opt in to JS type checking.

Example:
```
+-js-lib
| +-index.js
| +-package.json
|
+-ts-consumer
  +-index.ts
  +-package.json
  +-tsconfig.json
```
## js-lib/index.js
```js
/**
 * @param {string} s
 * @returns {number}
 */
module.exports = function test(s) { return parseInt(s) };
```

## js-lib/package.json
```json
{
  "name": "js-lib",
  "main": "index.js"
}
```

## ts-consumer/index.ts
```ts
import test = require('../js-lib');
// index.ts(1,23): error TS6143: Module '../js-lib' was resolved to '/Users/jarrad/src/personal/ts-test/lib/js-index.js', but '--allowJs' is not set.

import test = require('js-lib'); // after npm install ../js-lib
// index.ts(1,23): error TS7016: Could not find a declaration file for module 'lib'. '/Users/jarrad/src/personal/ts-test/lib/index.js' implicitly has an 'any' type.
//  Try `npm install @types/lib` if it exists or add a new declaration (.d.ts) file containing `declare module 'lib';

test("test");
```

## ts-consumer/tsconfig.json
```js
{
  "compilerOptions": {
    "strict": true
  }
}
```

It should be possible for me to make my `js-lib` usable to Typescript authors without them having to configure their own project with `allowJs` and `checkJs`.