sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Proposal: Partial Type Argument Inference
Labels: Suggestion,Needs Proposal

After exploring the concept in #23696, we've come to the conclusion that implicitly making type arguments available by name would unnecessarily expose previously unobservable implementation details. As such, I'll be breaking that proposal down into two parts. One is just the partial inference (which is here), which can stand on its own, as discussed in #20122 and #10571.

To recap, partial type argument inference is the idea that some number of type arguments in a type argument list may be provided, while others are elided and fulfilled via inference using the rest. Specifically, in #10571 a number of different syntax proposals will brought forward:

For the following examples, assume we have a 
```ts
declare foo<A,B,C>(): [A, B, C];
```

# Variant 1 - elided entries
```ts
foo<,,string>(); // returns [{}, {}, string]
```
This is the most terse option, as simply the lack of inputs implies inference sites. This would almost seem to logically follow from how not providing a list also causes inference to occur at all sites. This does have issues, however: specifying a final parameter as needing inference would require a trailing `,` in the list (something we currently explicitly disallow), and lists could very easily become confusing, as a `,` is very easy to skip over.

# Variant 2 - Sigil marker
```ts
foo<*, *, string>(); // returns [{}, {}, string]
```
As the second most terse option, this also has appeal; however I think it also fails on a few points. First, `*` is non-obvious what it means; it implies a "wildcard" of some kind, but in the context of types that could mean an inferred type, a bound, or an existential. Second, as a single-character sigil, we're unlikely to meaningfully provide completions for it even though it is contextually relevant. Finally, we're considering other work to do with existentials and generated type parameters in the future which we'd like to be able to use the `*` as an indicator for.

# Variant 3 - Keyword marker
a. `auto`
```ts
foo<auto, auto, string>(); // returns [{}, {}, string]
```
b. `infer`
```ts
foo<infer, infer, string>(); // returns [{}, {}, string]
```
Neither of these are as terse as the others, but both are still likely substantially shorter than providing the entire list of types by hand in situations where partial inference is desired. Of the two keywords, `auto` may be shorter, but currently carries no meaning within the language. `infer` on the other hand is _already_ used for marking inference positions within conditional types. The `infer` method was explored in #22368, however was taken much father - almost fully replicating the arbitrary placement and naming the operator affords within conditional types.

In the end, I'm advocating for variant 3b - the `infer` placeholder, with none of the extra features afforded in #22368 (we can always add them later if there is demand).
Repository: rust
Issue: hits llvm assertion "Cannot start a running timer" when timing passes
Labels: A-LLVM,T-compiler

build config:
````diff
--- config.toml.example 2018-08-06 21:33:10.482203459 +0200
+++ config.toml 2018-08-06 21:33:07.098838544 +0200
@@ -25,7 +25,7 @@
 #release-debuginfo = false
 # Indicates whether the LLVM assertions are enabled or not
-#assertions = false
+assertions = true
 # Indicates whether ccache is used when building LLVM
 #ccache = false
@@ -253,7 +253,7 @@
 # Whether or not debug assertions are enabled for the compiler and standard
 # library. Also enables compilation of debug! and trace! logging macros.
-#debug-assertions = false
+debug-assertions = true
 # Whether or not debuginfo is emitted
 #debuginfo = false
````
I built llvm with assertions enabled and debug assertions.
When building projects with ````RUSTFLAGS="-Ztime-passes -Ztime-llvm-passes"```` I often hit an assertion:
````
rustc: /home/matthias/RUST/rust_build/src/llvm/lib/Support/Timer.cpp:135: void llvm::Timer::startTimer(): Assertion `!Running && "Cannot start a running timer"' failed.
    time: 0.125; rss: 142MB LTO passes
error: Could not compile `num-traits`.
warning: build failed, waiting for other jobs to finish...
    time: 0.039; rss: 142MB codegen passes [build_script_build1-efc1c31eeff815f1eaec24de83c99086.rs]
    time: 0.322; rss: 147MB LTO passes
    time: 0.102; rss: 148MB LTO passes
rustc: /home/matthias/RUST/rust_build/src/llvm/lib/Support/Timer.cpp:135: void llvm::Timer::startTimer(): Assertion `!Running && "Cannot start a running timer"' failed.
error: Could not compile `version_check`.
warning: build failed, waiting for other jobs to finish...
    time: 0.103; rss: 143MB LTO passes
    time: 0.032; rss: 143MB LTO passes
rustc: /home/matthias/RUST/rust_build/src/llvm/lib/Support/Timer.cpp:135: void llvm::Timer::startTimer(): Assertion `!Running && "Cannot start a running timer"' failed.
error: Could not compile `num-integer`.
````

https://github.com/rust-lang/llvm/blob/rust-llvm-release-7-0-0-v2/lib/Support/Timer.cpp#L135

It looks like the assertion is triggered by one of the ````-Ztime-passes -Ztime-llvm-passes```` flags
Repository: flutter
Issue: Would like a way to have an isolate which does not provide `dart:io`
Labels: c: new feature,engine,dependency: dart,customer: dream (g3),P2,team-engine,triaged-engine

customer:dream has asked for the ability to launch an isolate without providing it access to dart:io.

Similarly @sbaranov mentions that if we ever implement https://github.com/flutter/flutter/issues/14330 for iOS, that may also require such a boundary to comply with store guidelines.
Repository: rust
Issue: rustdoc disregards job limit
Labels: T-rustdoc,A-libtest,A-doctests

When running doctests (via `cargo doc` or `cargo test`) rustdoc will compile each doctest separately, keeping a queue of compilation jobs. Maximum size of the queue seems to be limited to the number of CPUs in the system, but there seems to be no way to adjust that via command line or other configuration (`--jobs N` is ignored, for example).

This is particularly nasty on my laptop with 8 CPUs and only 8 GB of RAM that are quickly consumed by eight linkers running in parallel with all other stuff. Lying to rustdoc about CPU count by hooking sysconf() helps as a workaround, but this is hardly an elegant solution.
Repository: nvm
Issue: Recommend to autoremove
Labels: feature requests

I suggest to add a feature similar to autoremove from apt-get.

On install of a new version it could suggest to run autoremove. When doing so it should ask what Node.js versions should be removed e.g., all but the latest of each major; all but the latest; all but versions below the current default.

Besides that it would be great to also add a option to the installer to auto remove the last minor / patch version on installing a newer version.
Repository: pytorch
Issue: [feature request] Runtime warning for inappropriate labels (among others)
Labels: module: loss,module: error checking,triaged

While you can get an exception when passing integers where floats are required, I believe there are no checks that actually make sure that you are using the expected **values** within your tensors. In turn, this makes tracking problems in your models a bit more challenging.

For instance, when using [`nn.CosineEmbeddingLoss`](https://pytorch.org/docs/stable/nn.html#torch.nn.CosineEmbeddingLoss), that asks for `target` to take either `1` or `-1`, nothing stops you from providing something else and experiencing weird model behaviour when the method silently interpretes it in its own way.

For example:

```
criterion = torch.nn.CosineEmbeddingLoss()

vec1 = torch.tensor([[1., 2., 3.]])
vec2 = torch.tensor([[1., 2., 3.]])

loss1 = criterion(a, b, torch.tensor([1.])) # returns 0
loss2 = criterion(a, b, torch.tensor([0.])) # returns 0
loss3 = criterion(a, b, torch.tensor([-0.5])) # returns 0
loss4 = criterion(a, b, torch.tensor([-0.99])) # returns 0
loss5 = criterion(a, b, torch.tensor([-1.])) # returns 1
```

To give an anecdote, I thought that the method takes `0` and `1` instead of `-1` and `1` and the rest is a long debugging history. :)

## System Info
PyTorch version: 0.4.0
Is debug build: No
CUDA used to build PyTorch: 8.0.61

OS: Ubuntu 16.04.3 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
CMake version: version 3.5.1

Python version: 3.5
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration:
GPU 0: GeForce GTX 1080
GPU 1: GeForce GTX 1080

Nvidia driver version: 390.30
cuDNN version: Probably one of the following:
/usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.5.1.5
/usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.6.0.21
/usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn_static.a

Versions of relevant libraries:
[pip3] numpy (1.14.1)
[pip3] torch (0.4.0)
[pip3] torchtext (0.2.3)
[pip3] torchvision (0.2.1)
[conda] Could not collect

cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser
Repository: go
Issue: proposal: x/crypto/ssh: new callbacks to Config and error type
Labels: Proposal,Proposal-Crypto

### What version of Go are you using (`go version`)?
1.9.4 (but it doesn't matter, this isn't in the stdlib yet)

### Does this issue reproduce with the latest release?
Yes.

### What operating system and processor architecture are you using (`go env`)?
Doesn't matter.

### What did you do?

I'm trying to get more info from SSH servers, and the API of x/crypto/ssh is not very friendly.

1. I can only list acceptable crypto algorithms, not find out which the remote end support. One reason for wanting this is that I want to check *all* host keys, but the `HostKeyCallback` is only called for the negotiated one. The error message includes all algorithms remote end supports, but it's not programmatically extractable.
2. No good way to reject host key *and know that's why `Dial` failed*.

### What did you expect to see?

1. `Config.Remote{Ciphers,KeyExchanges,MACs}` callbacks
2. Being able to identify the error returned by `ClientConfig.HostKeyCallback` so that I know it failed because I wanted it to.

### What did you see instead?

API with deficiencies.

### Suggested improvements

1. Add `Remote{Ciphers,KeyExchanges,MACs}` callbacks to `type Config`
2. Add type `HostKeyError`, wrapping the error returned from the callback.
Repository: TypeScript
Issue: createProgram calls host.getSourceFile multiple times
Labels: Docs

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.1.0-dev.20180807

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Repro**

```ts
declare let oldProgram: ts.Program;
const originalHost = ts.createCompilerHost(true);
const host = {
  ... originalHost,
  getSourceFile(fileName, ...args) {
    console.log(fileName);
    return originalHost.getSoruceFile(fileName, ...args);
  }
const newProgram = ts.createProgram(oldProgram.getRootFileNames(), oldProgram.getCompilerOptions(), host, oldProgram);
```

**Expected behavior:**

Each fileName is logged once.

**Actual behavior:**

If `structureIsReused !== Completely` fileNames are logged twice: one time from `tryReuseStructureFromOldProgram` and another time from `findSourceFile`. That means these SourceFiles are requested multiple times. This is especially a problem with the default CompilerHost which has no caching. It therefore reads and parses each file multiple times, but only the last one is actually used.
Repository: TypeScript
Issue: Refactor "move to function in module scope" moves function past the following variable declaration
Labels: Bug,Help Wanted,Domain: Refactorings

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.1.0-dev.20180807

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** refactor function module

**Code**
```ts
import "fs";

function foo() {
	const bar = 1; // select this line
}

let flag = false;
function doSomethingWithFlag() {
}
```

1. select the line with the comment
2. choose "extract to function in module scope"

**Expected behavior:**
```ts
import "fs";

function newFunction() {
	return 1;
}

function foo() {
	const bar = newFunction();
}

let flag = false;
function doSomethingWithFlag() {
}
```
or
```ts
import "fs";

function foo() {
	const bar = newFunction();
}

function newFunction() {
	return 1;
}

let flag = false;
function doSomethingWithFlag() {
}
```
**Actual behavior:**
```ts
import "fs";

function foo() {
	const bar = newFunction();
}

let flag = false;
function newFunction() {
	return 1;
}

function doSomethingWithFlag() {
}
```
Repository: pytorch
Issue: [Caffe2] ConvPoolOpBase operator
Labels: caffe2

Hello all,

can you please provide an example showing **how to set the ConvPoolOpBase operator** (which provides the stride and kernel size, or the pads' sizes in each direction) to be able to use the MaxPool and Conv operators for network modelling? It would be nice to have a reference for it since I haven't found any example.

I am interested in **modelling networks** using **only operators** and **not any helper functions**.
Repository: TypeScript
Issue: In JS, extra circular reference errors when referring to a missing property on `module`
Labels: Bug

I think this error is wrong, a result of #26236 combined with (probably) #25732. Here's a repro based on lodash:

```
var freeModule = module.nodeType;
var Buffer = module.nodeType ? root.Buffer : undefined;

/**
 * Creates a clone of  `buffer`.
 *
 * @private
 * @param {Buffer} buffer The buffer to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Buffer} Returns the cloned buffer.
 */
function cloneBuffer(buffer, isDeep) {
}

module.exports = cloneBuffer;
```

**Expected behavior:**
No error on either type reference to Buffer in a param tag.

**Actual behavior:**
Error on both, and both say they have a circular reference error.
Repository: angular
Issue: Calling platformBrowserDynamic a second time silently ignores extraProviders
Labels: hotlist: error messages,freq1: low,area: core,core: di,core: bootstrap,type: confusing,P5

## I'm submitting a...
<pre><code>
[x] Bug report
</code></pre>

## Current behavior
```js
platformBrowserDynamic().bootstrapModule(ModuleOne);

platformBrowserDynamic([
    {
        provide: 'myValue',
        useValue: 'something',
    }
]).bootstrapModule(ModuleTwo)
```

Both applications are bootstrapped but `'myValue'` is not available to `ModuleTwo`.

You wouldn't write code like this in a single file but it may happen that independent code both calls `platformBrowserDynamic()`.

## Expected behavior

Either
- Make the `extraProviders` available to the bootstrapped module
- Or throw an error saying you cannot call this function twice
- Or throw an error that calling it twice must have the same arguments.

## What is the motivation / use case for changing the behavior?

The issue is hard to debug. Existing code can be broken by newly added independent code if that new code calls `platformBrowserDynamic()` earlier.

## Environment

Angular version: 6.1.1
Browser: not browser-specific
Repository: flutter
Issue: Multiple GlobalKey error hard to debug
Labels: framework,a: debugging,c: proposal,a: error message,P2,team-framework,triaged-framework

Having the same GlobalKey appear in multiple places in the tree currently throws an error like 

```
flutter: The following assertion was thrown building DefaultTextStyle(inherit: true, color:
flutter:   WidgetX
flutter: Multiple widgets used the same GlobalKey.
flutter: The key [GlobalKey#206b5] was used by multiple widgets. The parents of those widgets were different
flutter: widgets that both had the following description:
flutter:   WidgetX
flutter: A GlobalKey can only be specified on one widget at a time in the widget tree.
```

Which describes what the problem is but not why it occurred or how to fix it (if you're developing in a part of an app and don't own the whole app and this issue is caused somewhere by an ancestor). 

We should print 2 the ancestry chains to help with diagnosis.
Repository: TypeScript
Issue: Class method autocompletions not working properly on class with mixins
Labels: Bug

_From @Floriferous on August 6, 2018 20:25_

When composing a class together through mixins, the intellisense autocompletion does not work properly:

```js
// @flow
/* eslint-env mocha */
import { expect } from 'chai';
import { compose } from 'recompose';

class RootCalculator {
  constructor() {
    this.initializer = 2;
  }

  add(a: number, b: number): number {
    return a + b;
  }

  returnVarParent() {
    return this.var;
  }

  return2(): number {
    return 2;
  }

  parentFunc() {
    return this.childFunc();
  }
}

const withCalc2 = (SuperClass = class {}) =>
  class extends SuperClass {
    constructor() {
      super();
      this.initializer = this.initializer * 2;
    }

    increment(a: number): number {
      return a + 1;
    }

    setVar(value): void {
      this.var = value;
    }
  };

const withCalc3 = SuperClass =>
  class extends SuperClass {
    constructor() {
      super();
      this.initializer = this.initializer + 1;
    }

    multiply(a: number, b: number): number {
      return a * b;
    }

    returnVarChild(): void {
      return this.var;
    }

    return2(): number {
      return -2;
    }

    childFunc() {
      return 'it works';
    }
  };

const UberClass = compose(
  withCalc3,
  withCalc2,
)(RootCalculator);

const calculator = new UberClass();

calculator. // Wait for autocomplete, it can't find the class methods, or suggests them after plenty of other stuff
```

<img width="534" alt="screen shot 2018-08-06 at 22 24 33" src="https://user-images.githubusercontent.com/10428082/43739208-888aef5c-99c7-11e8-9676-6002140072d2.png">


_Copied from original issue: Microsoft/vscode#55910_
Repository: TypeScript
Issue: Support open-ended unions
Labels: Suggestion,Needs Proposal

## Suggestion

Ability to discriminate between union members when not all union members are known.

## Use Cases

* redux actions: See https://github.com/Microsoft/TypeScript/issues/2214#issuecomment-352103680
* This would enable us to discriminate on Node kinds without converting Node to a huge union (which slows down compilation too much). (Also, Node is effectively open-ended because we add new kinds fairly often.)

## Examples

```ts
interface Shape {
    unique kind: string;
}

interface Square extends Shape {
    kind: "square";
    size: number;
}

interface Circle extends Shape {
    kind: "circle";
    radius: number;
}

// other shapes may exist

function area(s: Shape) {
    switch (s.kind) {
        case "square":
            return s.size * s.size;
        case "circle":
            return Math.PI * s.radius ** 2;
        default:
            return 0; // Or hand off to some other function that handles other Shape kinds
    }
}
```

## 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. new expression-level syntax)

## Workarounds

Cast the general type to a union of known type.
```ts
function area(sIn: Shape) {
    const s = sIn as Square | Circle;
    ...
```
Repository: TypeScript
Issue: In JS, JS containers can't be augmented inside an IIFE
Labels: Bug

```js
var Ns = {};
(function () {
  Ns.x = 1
})()
Ns.x
```

**Expected behavior:**
No errors. Ns.x should be visible inside and outside the IIFE.

**Actual behavior:**
No errors, but completion dooesn't suggest 'x' as a property of Ns and Ns.x ends up with type any.
Repository: TypeScript
Issue: JS: Can't assign to superclass property
Labels: Bug,Domain: JSDoc,checkJs,Domain: JavaScript

**TypeScript Version:**  3.1.0-dev.20180807

**Code**

**a.js**
```ts
class A {
    constructor() {
        this.initializer = 2;
    }
}

class B extends A {
    constructor() {
        super();
        this.initializer = this.initializer + 1;
    }
}
```

**Expected behavior:**

No error.

**Actual behavior:**

```
src/a.js:10:9 - error TS7022: 'initializer' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

10         this.initializer = this.initializer + 1;
```
Repository: pytorch
Issue: [Caffe2] Which document should we follow to install caffe2?
Labels: caffe2

There are at least TWO "official" documents for caffe2:
(1) https://github.com/pytorch/pytorch#from-source
(2) https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile

Which one should we follow?
As we noticed that there are lots of questions in building caffe2, it would be nice if there is an "official" way to do it other than multiple documents that are different from each other. Thanks.
Repository: pytorch
Issue: [Caffe2] which kind of database can I read from caffe2
Labels: caffe2

I know caffe2 support lmdb, leveldb, hdf5. But after I move to the pytorch prebuilt by anaconda, I find all these features were turned off. Now I can't use Save, Load, CreateDB operators with the database formats I am familiar with.

I don't want build pytorch myself. that is too brutal to get these features. I just want to know which kind of database format is supported by default. Thx
Repository: rust
Issue: docs for extend_from_slice say extend isnt specialized for slice yet
Labels: C-enhancement,P-low,A-collections,T-libs-api,A-docs

Noticed an error in the docs of Vec::extend_from_slice:

> Note that this function is same as extend except that it is specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available).

extend is already specialized for slices
Repository: go
Issue: go/types: 25% of time used in map insertions
Labels: Performance

Reminder issue to investigate.

From an e-mail by @alandonovan:

FYI: a profile of a go/types app showed nodeSet.add's use of map insertions accounts for 25% of all typechecking time.  Something to look at on a rainy day (if you find yourself in SF this summer).