sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: --noImplicitAny codefix inferring string for complex object
Labels: Suggestion,Domain: Quick Fixes,Experience Enhancement

**TypeScript Version:**  3.3.0-dev.20190108

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** noimplicitany infer code fix codefix string object data

**Code**

```ts
function cleanup(data) {
  if (Array.isArray(data)) {
    return data.map(cleanup)
  }
  if (!data || typeof data !== 'object') return data

  let keys = Object.keys(data)
  if (keys.length <= 3 &&
    data.name &&
    (keys.length === 1 ||
      keys.length === 3 && data.email && data.url ||
      keys.length === 2 && (data.email || data.url))) {
    data = unparsePerson(data)
  }
  return data
}
```

**Expected behavior:**

`--noImplicitAny` suggested fix on the `data` parameter: unclear what this should be. Perhaps a fancy type union containing an anonymous object type with fields such as `name` and `url`?

**Actual behavior:**

```typescript
function cleanup(data: string) {
```

**Related Issues:** #13243 _(parent tracking quick fixes)_
Repository: go
Issue: x/build/env: run more tests in js-wasm trybot mode
Labels: Builders,NeedsInvestigation

See #29632 wherein the build breaks due to js-wasm skipping too many tests on trybots.

We could just shard out the js-wasm trybot builder wider and enable more tests.
Repository: TypeScript
Issue: Constructor property inheritance is not giving an error in ES2015+ target
Labels: Bug

**TypeScript Version:**  3.2.2

**Search Terms:** property inheritance constructor super

**Code**

```ts
abstract class A {
  public names = ['A'];
}

class B extends A {
  public names = [...super.names, 'B'];
}

const b = new B();
alert(b.names);
```

**Expected behavior:**
ES2015+ target: either TypeScript downlevels `super.names` in the child class to `this.names` which would make that code work, or it should give an error like it does in the ES5 version (check playground link).

Working ES2015 version:
```js
class A {
  constructor() {
    this.names = ['A'];
  }
}

class B extends A {
  constructor() {
    super(...arguments);
    this.names = [...this.names, 'B']; // `super` -> `this` so that this works as expected, but maybe not correct, not sure of the implications.
  }
}

const b = new B();
alert(b.names);
```

So either that, or give a compile error. (ES5 target gives a compile error that has nothing to do with the actual error, so maybe even that should be sorted out)

**Actual behavior:**
Compiles fine under ES2015+ target, but gives a runtime error. (check stackblitz link)

**Playground Link:** https://www.typescriptlang.org/play/index.html#src=abstract%20class%20A%20%7B%0A%20%20public%20names%20%3D%20%5B'A'%5D%3B%0A%7D%0A%0Aclass%20B%20extends%20A%20%7B%0A%20%20public%20names%20%3D%20%5B...super.names%2C%20'B'%5D%3B%0A%7D%0A%0Aconst%20b%20%3D%20new%20B()%3B%0Aalert(b.names)%3B%0A

**Stackblitz Link:** https://stackblitz.com/edit/typescript-jcg479

**Related Issues:** I've tried, but couldn't really find anything similar. Forgive me if it has been reported already.
Repository: TypeScript
Issue: Path intellisense for other files besides js/ts
Labels: Suggestion,In Discussion

I would like to allow VScode intellisence can detect and show more file types when write import syntax.
for now when working with custom file type ex .vue file, editor only show js / ts file, .vue file is hidden.

my suggest is we have new setting:
`intellisence.suggest_file_types` and allow input custom file type want to load.
Like this we can control better.
Repository: flutter
Issue: IAP: Purchase a non-renewing subscription
Labels: c: new feature,p: in_app_purchase,package,team-ecosystem,P3,triaged-ecosystem
Repository: flutter
Issue: TextField shouldn't merge its semantics node into parent
Labels: a: text input,framework,f: material design,a: accessibility,customer: google,has reproducible steps,P2,workaround available,found in release: 3.7,team-design,triaged-design

```dart
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Foo(title: 'Flutter Demo Home Page'),
    );
  }
}

class Foo extends StatelessWidget {
  Foo({this.title});

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: Center(
        child: Card(
          child: Column(
            children: [
              Text('Hello'),
              Text('Foo'),
              TextField(
                decoration: InputDecoration(
                  labelText: 'Enter Credit Card',
                  hintText: '1234',
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

Semantics Tree:
```
flutter: SemanticsNode#0
flutter:  │ Rect.fromLTRB(0.0, 0.0, 750.0, 1334.0)
flutter:  │
flutter:  └─SemanticsNode#1
flutter:    │ Rect.fromLTRB(0.0, 0.0, 375.0, 667.0) scaled by 2.0x
flutter:    │ textDirection: ltr
flutter:    │
flutter:    └─SemanticsNode#2
flutter:      │ Rect.fromLTRB(0.0, 0.0, 375.0, 667.0)
flutter:      │ flags: scopesRoute
flutter:      │
flutter:      ├─SemanticsNode#4
flutter:      │ │ Rect.fromLTRB(0.0, 0.0, 375.0, 76.0)
flutter:      │ │
flutter:      │ └─SemanticsNode#5
flutter:      │     Rect.fromLTRB(82.5, 36.0, 292.5, 60.0)
flutter:      │     flags: isHeader
flutter:      │     label: "Flutter Demo Home Page"
flutter:      │     textDirection: ltr
flutter:      │
flutter:      └─SemanticsNode#3
flutter:          Rect.fromLTRB(0.0, 76.0, 375.0, 667.0)
flutter:          actions: tap
flutter:          flags: isTextField
flutter:          label:
flutter:            "Hello
flutter:            Foo
flutter:            Enter Credit Card"
flutter:          textDirection: ltr
```

The textfield stuff ("Enter Credit Card" and SemanticsFlag.isTextField) should not be merged with the Text "Hallo" and "Foo" into one SemanticsNode. TextFields should always own their own SemanticsNodes.
Repository: flutter
Issue: Camera document how to use ImageStream
Labels: d: api docs,customer: crowd,p: camera,package,team-ecosystem,P2,triaged-ecosystem

First of all thank you so mush for adding access to the image stream in 0.2.8, I'm sure may people will be very happy about this.
I know the latest commit is fresh off the press, bit I would love to see a little more documentation on how to use the camera image stream (other than: "use: `cameraController.startImageStream(listener)` to process the images")
Repository: pytorch
Issue: Broadcasting and Additional Dimensions for pairwise_distance
Labels: module: nn,triaged,function request,module: distance functions

## 🚀 Feature

`F.pairwise_distance` supports `[N,D]x[N,D]=[N]`.
Please add the support for `[*,D]x[*,D]=[*]` with broadcasting.

## Motivation

I am trying to implement a triplet loss.
From the network I have a embedding `[N, D]` and mean vectors `[M, D]`.
I need `N*M` distances between them. However `pdist` and `pairwise_distance` do not cover this.

If `pairwise_distance` supports multiple dimension, it is possible to unsqueeze them to `[N, 1, D]x[1,M,D]` and get the distances in `[N,M]`.


cc @albanD @mruberry
Repository: TypeScript
Issue: ES5 + downlevelIteration on spread operator disables strictNullChecks 
Labels: Bug

**TypeScript Version:** 3.3.0-dev.20190110

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Code**

```ts
declare const maybeArr: number[]|undefined;  // declare is load bearing, otherwise compiler seems to infer tighter type
const nums: number[] = [];
nums.push(...maybeArr);  // expected: undefined is not an array type, has no [Symbol.iterator]

// Actual practical instance where this came up:
const someMap = new Map<string, number[]>();
nums.push(...someMap.get('x'));  // expected: undefined is not an array type, has no [Symbol.iterator]
```

**Expected behavior:**

This should give a compile error with strictNullChecks, regardless of any other TypeScript compiler flags.

**Actual behavior:**

```sh
$ tsc --strictNullChecks --lib es2015 --target es5 --downlevelIteration test.ts
[ no error ]

$ tsc --strictNullChecks --lib es2015 --target es6 test.ts
test.ts:3:14 - error TS2488: Type 'undefined' must have a '[Symbol.iterator]()' method that returns an iterator.

3 nums.push(...maybeArr);
               ~~~~~~~~

test.ts:6:14 - error TS2488: Type 'undefined' must have a '[Symbol.iterator]()' method that returns an iterator.

6 nums.push(...someMap.get('x'));
               ~~~~~~~~~~~~~~~~
```

**Playground Link:** 
Link below does not show the problem in ES5/downlevelIteration mode.
http://www.typescriptlang.org/play/#src=declare%20const%20maybeArr%3A%20number%5B%5D%7Cundefined%3B%20%20%2F%2F%20declare%20is%20load%20bearing%2C%20otherwise%20compiler%20seems%20to%20infer%20tighter%20type%0Aconst%20nums%3A%20number%5B%5D%20%3D%20%5B%5D%3B%0Anums.push(...maybeArr)%3B%20%20%2F%2F%20expected%3A%20undefined%20is%20not%20an%20array%20type%2C%20has%20no%20%5BSymbol.iterator%5D%0A%0A%2F%2F%20Actual%20practical%20instance%20where%20this%20came%20up%3A%0Aconst%20someMap%20%3D%20new%20Map%3Cstring%2C%20number%5B%5D%3E()%3B%0Anums.push(...someMap.get('x'))%3B%20%20%2F%2F%20expected%3A%20undefined%20is%20not%20an%20array%20type%2C%20has%20no%20%5BSymbol.iterator%5D

**Related Issues:**

#17195 seems similar but was closed.
Repository: angular
Issue: After a reorder animation states doesn't get detected correctly
Labels: type: bug/fix,area: animations,freq1: low,P4

# 🐞 bug report

### Affected Package 
The issue is caused by package @angular/animations (I think)


### Is this a regression?
 Yes, the previous version in which this bug was not present was: 6 (at least)


### Description
When a bunch of elements are rendered with ngFor and an animation trigger, the trigger doesn't update correctly when the array has changed. Only some elements gets into the new animation states. 
Currently this is causing quite some problems for us, where some lists cannot be shown. 

## 🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-animation-issue

Click the "toggle" button to expand the items (notice how all the items gets shown)
Click the "reorder" button (Notice how all items still are shown)
Click the "toggle" button again. (Notice items are gone)
Click the "reorder" button (Nothing visibly changes)
Click the "toggle" button (Only some items become visible. 


If you change the animations to toggle between "display: none" and "display: ''", then the state changes happens as intended. 

## 🌍  Your Environment

All environment details available on Stackblitz

**Anything else relevant?**
Seems to happen in all browsers
Repository: flutter
Issue: App ignores proxy settings
Labels: c: new feature,framework,engine,dependency: dart,P2,team-engine,triaged-engine

We need a way to access the system configured proxy.
In networks where a proxy is required to enter the internet, this is critical. 

Currently, I'm not able to use any flutter app in such networks where a proxy is configured in the system settings.
Repository: TypeScript
Issue: Object.assign({}) seems to always return a type any
Labels: Bug,Domain: lib.d.ts

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.3.0-dev.20190110

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** Object.assign

**Code**

```ts
function foo(): {foo: string} {
    return Object.assign({});
}
```

Interestingly the code:

```ts
function bar(): {bar: string} {
    return Object.assign({}, {bar: 1});
}
```
does report the expected error

**Expected behavior:** TypeScript should report an error because the type returned by `return Object.assign({});` does not mach `{foo: string}` but instead the type any is assumed.

**Actual behavior:** No error is shown

**Playground Link:** https://www.typescriptlang.org/play/index.html#src=function%20foo()%3A%20%7Bfoo%3A%20string%7D%20%7B%0D%0A%20%20%20%20return%20Object.assign(%7B%7D)%3B%0D%0A%7D%0D%0A

**Related Issues:** no
Repository: rust
Issue: Infinite loop in try_push_visible_item_path 
Labels: E-needs-test,T-compiler,I-hang

This happens when an item has an infinite number of visible names:

```
// pathlooptest/src/lib.rs
pub struct AStruct;

pub mod prelude {
    pub use crate as pathlooptest;
    pub use crate::AStruct;
}
```

```
// main.rs
use pathlooptest::prelude::*;

pub fn main() {
    let x: AStruct = 42; // causes error, all public names of AStruct are generated?
}
```
Repository: TypeScript
Issue: Using compiled *.d.ts file produces a type error, but using the same type from the source file doesn't
Labels: Bug

Backstory: A type error bug was reported for a library of mine. I tried reproducing by writing code inside the library source and I couldn't reproduce it. I `npm install`-ed my library and I could indeed see the error that was reported (I used the same code snippet in both places). Turns out the type error only happens with the compiled type definitions file.

**TypeScript Version:**  3.2.2

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** class property, definition file

**Code**

__[SSCCE Repo link](https://github.com/gigobyte/typescript-issue-SSCCE)__

To reproduce: Clone the repo. Open `src/BUG_HERE.ts`. There will be a type error:

![image](https://user-images.githubusercontent.com/8791446/51001879-2a17cc80-153a-11e9-887e-2fe0c4678599.png)

```
Type 'Maybe<never>' is not assignable to type 'Maybe<number>'.
  Types of property ''fantasy-land/alt'' are incompatible.
    Type '(other: Maybe<never>) => Maybe<never>' is not assignable to type '(other: Maybe<number>) => Maybe<number>'.
      Types of parameters 'other' and 'other' are incompatible.
        Type 'Maybe<number>' is not assignable to type 'Maybe<never>'.
          Types of property 'value' are incompatible.
            Type 'number | undefined' is not assignable to type 'undefined'.
              Type 'number' is not assignable to type 'undefined'.
```

**Expected behavior:**

Either both functions must have a type error or both should compile, I'm not sure which is the correct behavior, the issue is in that only the imports from the definition file produce an error.

**Actual behavior:**

Module imported from source has no errors, same module compiled and imported does have an error even though it's used the same way.

**Observations from my research:**
* It may be related to class properties
* Turning off --strictFunctionTypes fixes the error
Repository: flutter
Issue: Building flutter tool can time out on fresh macos install
Labels: tool,platform-mac,a: first hour,P2,team-tool,triaged-tool

Running Flutter for the first time can trigger git which can trigger macOS to show a prompt to go get Xcode command line tools the first time it's run. That takes forever and we dump a scary error when the Flutter tool build times out.
Repository: terminal
Issue: GenerateConsoleCtrlEvent creates "zombie" process handle in conhost.exe
Labels: Product-Conhost,Area-Server,Issue-Bug

* Windows build number: 10.0.17763.195

* What you're doing and what's happening: I have an application that starts and stops many sub processes. We use 'GenerateConsoleCtrlEvent' to stop sub processes. Every time we use this function, the conhost.exe process associated with our main / parent process acquires a "zombie" process handle to the stopped sub process.

Here is sample code illustrating the issue which opens notepad, sends a Ctrl-C signal, and then terminates it:

```
#include <Windows.h>

int main(int argc, char *argv[])
{
    STARTUPINFO startInfo;
    PROCESS_INFORMATION processInfo;
    ZeroMemory(&startInfo, sizeof(startInfo));
    startInfo.cb = sizeof(startInfo);
    ZeroMemory(&processInfo, sizeof(processInfo));

    WCHAR *f = L"c:\\windows\\notepad.exe";

    BOOL bres = CreateProcess(f, nullptr, nullptr, nullptr, FALSE, CREATE_NEW_PROCESS_GROUP, nullptr, nullptr, &startInfo, &processInfo);

    DWORD  dw = GenerateConsoleCtrlEvent(CTRL_C_EVENT, processInfo.dwProcessId);

    TerminateProcess(processInfo.hProcess, 0);

    DWORD status = WaitForSingleObject(processInfo.hProcess, INFINITE);

    CloseHandle(processInfo.hProcess);
    CloseHandle(processInfo.hThread);

    // Observe zombie process handle in Process Explorer, owned by conhost.exe process associated with this process

    Sleep(1000 * 60 * 2);

    return 0;
}
```

If we open Process Explorer and view the handles owned by the conhost.exe process associated with the sample program ("Sandbox.exe" in my case):
![image](https://user-images.githubusercontent.com/8868121/51007609-fcf8f900-14fc-11e9-9da9-3145e7cf4fcb.png)

We see that there is a "zombie" process handle to the terminated notepad process:
![image](https://user-images.githubusercontent.com/8868121/51007576-dcc93a00-14fc-11e9-8564-805b2bbdf3e5.png)

If you step through the sample code, you can see that the process handle is opened on the call to 'GenerateConsoleCtrlEvent'.

* What's wrong / what should be happening instead: 'GenerateConsoleCtrlEvent' should not leave an open process handle to the target process after invocation.
Repository: flutter
Issue: Complete failure of google_sign_in disconnect()
Labels: platform-android,p: google_sign_in,package,P2,team-android,triaged-android

The "disconnect()" function in the google_sign_in package seems to be completely inoperative. Looking through the source it seems to do the right thing: signOut() calls the Java libary's signOut(), and disconnect() call's the Java library's revokeAccess().  But it does not in fact revoke anything--the name still appears in the list, and clicking it signs in again, no password or other authentication needed. I don't know if this is an error in the plugin, or in the underlying Java API.

This is a serious security issue. The user must be allowed to revoke his access to an app.
Repository: rust
Issue: diagnostics: suggets assert_eq!() instead of assert!() where appropriate
Labels: C-enhancement,A-diagnostics,A-macros,T-compiler,A-suggestion-diagnostics

````rust
fn main() {
    let x = 3;
    assert!(x, 3);
}
````
This currently gives an error like so:
````
error[E0308]: mismatched types
 --> src/main.rs:3:5
  |
3 |     assert!(x, 3);
  |     ^^^^^^^^^^^^^^ expected bool, found integer
  |
  = note: expected type `bool`
             found type `{integer}`

error: aborting due to previous error
````

If arguments 1 and 2 are the same type, it would be great if we could instead suggest using `assert_eq!` instead (preferably with rustfix applicable hint)!

Alternatively we could suggest transforming `x, 3` to `x == 3` but I guess `assert_eq!()` is more idiomatic.
Repository: TypeScript
Issue: Async LanguageServiceHost
Labels: Suggestion,In Discussion,API

## Search Terms

`language`, `service`, `host`, `async`, `api`

## Suggestion

It'd super awesome if Language Service would accept a LanguageServiceHost with async API

## Use Cases

Using `LanguageService` in environments where `readFileSync` is not available like browsers (using `browserfs` package or fs provided by `WebSockets`)

I'm working on an app like CodeSandbox but a bit more sophisticated.

## Examples

```typescript
class Host implements ts.LanguageServiceHost {
  async getScriptSnapshot(filename: string): Promise<ts.IScriptSnapshot> { }
  async readFile(filename: string): Promise<string> {}
}
```

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: go
Issue: proposal: net: add MarshalText/UnmarshalText to HardwareAddr
Labels: Proposal

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go1.10 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes.

### What did you do?

I'm trying to unmarshal json content into `net.IP` and `net.HardwareAddr`.
Both types are actually of type `[]byte`
Since `net.IP` implements `json.Marshaler`, it works as expected. However, net.HardwareAddr does not and fails with the error "illegal base64 data at input byte 2" (that's the position of the separator).

Here's an example:
https://play.golang.org/p/HOBBAyvpfrK

I found the google group discussion about adding the Marshaller to the `net.IP` type: https://groups.google.com/forum/#!topic/golang-nuts/io8aHJarm6U

### What did you expect to see?

I expect `net.HardwareAddr` to be consistent with `net.IP` and implement `json.Marshaler`.
Strings in the form of `"ab:cd:ef:ab:cd:ef"` inside json should be parsable to MAC addresses.