sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: angular
Issue: HTTP request triggers change detection twice
Labels: type: bug/fix,freq2: medium,area: zones,area: common/http,state: confirmed,P4

# 🐞 bug report

### Affected Package
```
@angular/http@6.1.10
zone.js@0.8.26
```

### Description
An HTTP request via `HttpClient#get` triggers change detection twice once the response is available.

## 🔬 Minimal Reproduction
There is a minimal example at https://stackblitz.com/edit/angular-issue-repro2-upg7ax

In this example `AppComponent#ngDoCheck` is called 4 times.
- The first 2 calls seem to be normal during bootstrapping of any application (although not documented).
- The 3rd and 4th call are the consequence of the HTTP request that got triggered. There is one change detection triggered by `readystatechange` event and another one triggered by `load` (also see the call trees in the screenshot below). In this case only one change detection should be triggered. From a change detection perspective one of them is redundant and reduces the app's performance.


## 🌍  Your Environment

**Angular Version:**
<pre><code>
Angular CLI: 6.2.8
Node: 8.11.3
OS: darwin x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.8
@angular-devkit/build-angular     0.8.8
@angular-devkit/build-optimizer   0.8.8
@angular-devkit/build-webpack     0.8.8
@angular-devkit/core              0.8.8
@angular-devkit/schematics        0.8.8
@angular/cli                      6.2.8
@ngtools/webpack                  6.2.8
@schematics/angular               0.8.8
@schematics/update                0.8.8
rxjs                              6.2.2
typescript                        2.9.2
webpack                           4.16.4
</code></pre>
Repository: angular
Issue: InputDecorator should have more specifiy return type than "any"
Labels: type: bug/fix,freq2: medium,area: core,state: confirmed,core: inputs / outputs,core: host and host bindings,cross-cutting: types,P4

<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅

Oh hi there! 😄 

To expedite issue processing please search open and closed issues before submitting a new one.
Existing issues often contain information about workarounds, resolution, or progress updates.

🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->


# 🐞 bug report

### Affected Package
<!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->
<!-- ✍️edit: --> The issue is caused by package @angular/core


### Is this a regression?

<!-- Did this behavior use to work in the previous version? -->
<!-- ✍️--> No

### Description
`InputDecorator`, when called as a function, has the return type `any`.
Using `@Input()` therefore causes a violation of TSLint's no-unsafe-any rule.

## 🔬 Minimal Reproduction
Use `@Input()` and run TSLint with rule "no-unsafe-any" set to true

`MyComponent.ts`
<pre><code>
export class MyComponent {
	@Input() public someInput: string;
}
</code></pre>

`Tslint.json`
<pre><code>no-unsafe-any: true</code></pre>

<!--
If StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue. Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.
-->

## 🌍  Your Environment

**Angular Version:**
<pre><code>TSLint: 5.11.0
Typescript: 3.1.3
</code></pre>
Repository: rust
Issue: Documentation should list the supported target platforms so the list can be exported on the site and be accesible to people evaluating Rust as a possible language choice
Labels: C-enhancement,T-infra
Repository: opencv
Issue: CL_INVALID_WORK_GROUP_SIZE issue
Labels: priority: low,category: ocl,platform: other

I have short test program trying to use OpenCL version of functions ...

```
cv::ocl::setUseOpenCL(true); // enable || disable OpenCL in the processing of UMat

UMat img,gray;
imread("lena30.jpg", 1).copyTo(img);

cvtColor(TIimg, TIgray, COLOR_BGR2GRAY);
GaussianBlur(TIgray, TIgray, Size(5, 5), 1.25);
Canny(TIgray, TIgray, 0, 30);

```
Unfortunately at runtime test program complains on workgroupsize...

```
[ INFO:0] Successfully initialized OpenCL cache directory: /home/root/.cache/opencv/3.4.1/opencl_cache/
[ INFO:0] Preparing OpenCL cache configuration for context: 
OpenCL error CL_INVALID_WORK_GROUP_SIZE (-54) during call: clEnqueueNDRangeKernel('stage1_with_sobel', dims=2, globalsize=512x512x1, localsize=32x32x1) sync=false

```
How can I set workgroups size and other opencl params before function execution?
Repository: rust
Issue: Different compiler versions disagree on whether failure_derive macro is used or not
Labels: C-enhancement,A-diagnostics,T-compiler

This leads to some compatibility issues. The code I have now compiles on 1.25.0 and 1.28.0 but reports an unused ```[macro_use]``` import for 1.31.0. https://travis-ci.org/stratis-storage/devicemapper-rs/jobs/466549505. Is this a bug in Rust, or something about the behavior of the ```failure_derive``` crate?

Duplicate issue in failure crate: https://github.com/rust-lang-nursery/failure/issues/278, because I'm hoping someone has a hunch about which it is.
Repository: go
Issue: runtime: incorrect constant value for PROCESS_ALL_ACCESS
Labels: Testing,NeedsInvestigation,compiler/runtime

https://github.com/golang/go/blob/01e072db5d26c224dfbe7763a5b94ab23c163983/src/runtime/syscall_windows_test.go#L815

From winnt.h we can see that if we are running on a version of Windows greater than Vista, `0xFFFF` should be or-ed with the `STANDARD_RIGHTS_REQUIRED` and `SYNCHRONIZE` flags.

_winnt.h#L11279_
```c++
#if (NTDDI_VERSION >= NTDDI_VISTA)
#define PROCESS_ALL_ACCESS        (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
                                   0xFFFF)
#else
#define PROCESS_ALL_ACCESS        (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
                                   0xFFF)
#endif
```
Repository: flutter
Issue: `flutter doctor` should report whether the Flutter install dir is clean
Labels: c: new feature,tool,t: flutter doctor,P2,team-tool,triaged-tool

If the Flutter install directory contains any changes `flutter doctor` or `flutter doctor -v` should report that.

It would make it easier for support questions that are caused by inadvertently modified files in the Flutter install dir.

I created https://github.com/flutter/flutter/wiki/Workarounds-for-common-issues#flutter-installation-corrupted because this happens quite a lot.

See also #9218
I'd suggest to do the `git clean -xfd` `git stash drop`, ... when `--force` (`flutter upgrade --force`, `flutter channel foo --force`) is passed.
It might be useful to execute the `git clean` stuff with `flutter upgrade --force` even when no upgrade is available.
Repository: You-Dont-Know-JS
Issue: this & Object Prototypes - Chapter 3: Symbol.iterator enumerablility
Labels: for second edition

In the end of the chapter there's an example and statement:
```js
var myObject = {
	a: 2,
	b: 3
};

Object.defineProperty( myObject, Symbol.iterator, {
	enumerable: false,
	writable: false,
	configurable: true,
	value: function() {
		var o = this;
		var idx = 0;
		var ks = Object.keys( o );
		return {
			next: function() {
				return {
					value: o[ks[idx++]],
					done: (idx > ks.length)
				};
			}
		};
	}
} );

// iterate `myObject` manually
var it = myObject[Symbol.iterator]();
it.next(); // { value:2, done:false }
it.next(); // { value:3, done:false }
it.next(); // { value:undefined, done:true }

// iterate `myObject` with `for..of`
for (var v of myObject) {
	console.log( v );
}
// 2
// 3
```
> **Note:** We used `Object.defineProperty(..)` to define our custom `@@iterator` (mostly so we could make it non-enumerable), but using the `Symbol` as a *computed property name* (covered earlier in this chapter), we could have declared it directly, like `var myObject = { a:2, b:3, [Symbol.iterator]: function(){ /* .. */ } }`.

I'm somewhat confused by the part:
> (mostly so we could make it non-enumerable)

[MDN states](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) that `Symbol.iterator` is non-enumerable, my own experimentation is a little bit confusing...
```js
const iterable = {
  a: 1,
  [Symbol.iterator]: function() {}
};

for (x in iterable) console.log(x); // a

console.log(iterable.propertyIsEnumerable(Symbol.iterator)); // true ...WTF?!
```

Is there something else we should know?
Repository: create-react-app
Issue: Add a way to specify an alternate tsconfig for production builds
Labels: issue: proposal

### Is this a bug report?

No. This is a feature request. Our team is now using CRA with TS and it is great! One thing we can't seem to find is any information on is having different TS compiler settings when doing a production build. Simply adding a `tsconfig.prod.json` appears to have no effect. I can't seem to find a documented way to add this and it would be super useful!

### Did you try recovering your dependencies?

N/A

### Which terms did you search for in User Guide?

TypeScript https://reactjs.org/docs/static-type-checking.html#typescript

### Environment

```
Environment Info:

  System:
    OS: macOS 10.14.1
    CPU: x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
  Binaries:
    Node: 10.14.0 - /usr/local/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/Projects/cirrus-admin-webapp/node_modules/.bin/npm
  Browsers:
    Chrome: 70.0.3538.110
    Firefox: 63.0.3
    Safari: 12.0.1
  npmPackages:
    @types/react: 16.7.7 => 16.7.7
    @types/react-dom: 16.0.11 => 16.0.11
    react: 16.6.3 => 16.6.3
    react-dom: 16.6.3 => 16.6.3
    react-scripts: 2.1.1 => 2.1.1
  npmGlobalPackages:
    create-react-app: Not Found
```

### Steps to Reproduce

1. Add TS to your project as outlined in the docs.
2. Attempt to add a `tsconfig.prod.json` with different settings than `tsconfig.json`:
```json
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "noUnusedLocals": true
  }
}
```
3. Run `yarn build` or whatever you have configured to do a production build with `react-scripts`
4. Notice the settings aren't applied.


### Expected Behavior

It would honor the `tsconfig.prod.json`

### Actual Behavior

It honors the original `tsconfig.json`.

### Reproducible Demo

N/A. I can add one later if people have any issues reproducing.
Repository: TypeScript
Issue: PluginModule.onConfigurationChanged not called when plugin config in tsconfig.json changes
Labels: Suggestion,Domain: TSServer,Experience Enhancement

<!-- 🚨 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.3.0-dev.20181208

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

plugin configuration change
onConfigurationChanged

**Expected behavior:**

`PluginModule.onConfigurationChanged` is called when the configuration of the plugin in `tsconfig.json` changes. The Project already watches the tsconfig.json and therefore knows when the config of a plugin changes.

**Actual behavior:**

`PluginModule.onConfigurationChanged` is only called when the client sends a `ConfigurePlugin` command.

**Related Issues:**
#15915 is basically the same issue from 1,5 years ago. Back then it was decided this is working as intended and a plugin is responsible for watching the config file.
In the meantime `onConfigurationChanged` was introduced in #28106. Since `ConfigurePlugin` command is supposed to override any config in tsconfig.json, a plugin that watches for config file changes would need special handling to account for that fact.
Repository: angular
Issue: Support ::slotted() in ViewEncapsulation.Emulated
Labels: feature,action: discuss,area: core,state: has PR,core: CSS encapsulation,feature: under consideration

# 🚀 feature request

This was discussed previously in #11595 and (incorrectly) closed as complete by @robwormald.

### Relevant Package

@angular/core

### Description

::slotted() is part of the Shadow DOM [working draft](https://drafts.csswg.org/css-scoping/#slotted-pseudo) (see also [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/::slotted)), with significant support by vendors. 

### Describe the solution you'd like

ViewEncapsulation.Emulated supports ::slotted(), following the behavior in the Shadow DOM specification.

### Describe alternatives you've considered

ViewEncapsulation.Native is a viable alternative for some browsers.

However, neither IE or current Edge supports ::slotted, and Safari support is buggy (https://caniuse.com/#feat=shadowdomv1).

::ng-deep is currently the only viable alternative, but Angular has deprecated it.
Repository: go
Issue: cmd/go: 'go mod download' of a replaced module downloads the go.mod for its replacement
Labels: NeedsFix,GoCommand,modules

`go mod download` of a specific version of a module should download *only* that module.

Today, if that version happens to have a replacement, `go mod download` also downloads the `go.mod` file (but not the `.zip` file) for its replacement.

<details>

```
$ go mod init golang.org/issue/scratch
go: creating new go.mod: module golang.org/issue/scratch

$ go mod edit -require golang.org/x/text@v0.2.0
$ go mod edit -replace golang.org/x/text@v0.2.0=golang.org/x/text@v0.3.0
$ go mod download -json golang.org/x/text@v0.2.0
go: finding golang.org/x/text v0.3.0
go: finding golang.org/x/text v0.2.0
{
        "Path": "golang.org/x/text",
        "Version": "v0.2.0",
        "Info": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.info",
        "GoMod": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.mod",
        "Zip": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.zip",
        "Dir": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/golang.org/x/text@v0.2.0",
        "Sum": "h1:WtDSLEtcB5GqbjSlyn8XcYtxjw+SgFMc2RILOvq7CuE=",
        "GoModSum": "h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ="
}

$ find $GOPATH -name '*.mod'
/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.mod
/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.3.0.mod

$ find $GOPATH -name '*.zip'
/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.zip
```

</details>
Repository: node
Issue: http2: streams can emit 'close' before 'end' and/or 'finish'
Labels: http2

Based on https://github.com/nodejs/node/commit/83ec33b9335a7140c1f8b46357303ff7a8122a0d

>  My understanding is that ideally, streams
> should not emit `'close'` before `'end'` and/or `'finished'`, so this
> might be another bug, but changing this would require modifying tests
> and almost certainly be a breaking change.
Repository: pytorch
Issue: torch.save does not work if nn.Module has partial JIT.
Labels: oncall: jit

## 🐛 Bug


## To Reproduce

Steps to reproduce the behavior:

```python
import torch
import torch.nn as nn


class Sub(torch.jit.ScriptModule):
    def __init__(self):
        super(Sub, self).__init__()
        self.weight = nn.Parameter(torch.randn(2))

    @torch.jit.script_method
    def forward(self, thing):
        return self.weight + thing


class M(torch.jit.ScriptModule):
    __constants__ = ['mods']

    def __init__(self):
        super(M, self).__init__()
        self.mods = nn.ModuleList([Sub() for i in range(10)])

    @torch.jit.script_method
    def forward(self, v):
        for m in self.mods:
            v = m(v)
        return v


class Wrap(torch.nn.Module):
    def __init__(self):
        super(Wrap, self).__init__()
        self.m = M()

    def forward(self, x):
        return self.m(x)

w = Wrap()
torch.save(w, './test')
```
```
TypeError: can't pickle M objects
```

## Expected behavior

Successfully saving the model.

## Environment
```
PyTorch version: 1.0.0a0+db5d313
Is debug build: No
CUDA used to build PyTorch: 9.2.148

OS: Ubuntu 18.04.1 LTS
GCC version: (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
CMake version: version 3.12.2

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 9.2.148
GPU models and configuration: GPU 0: GeForce GTX 1080 Ti
Nvidia driver version: 410.73
cuDNN version: Probably one of the following:
/usr/local/cuda-9.2/lib64/libcudnn.so
/usr/local/cuda-9.2/lib64/libcudnn.so.7
/usr/local/cuda-9.2/lib64/libcudnn.so.7.0.3
/usr/local/cuda-9.2/lib64/libcudnn_static.a

Versions of relevant libraries:
[pip] Could not collect
[conda] blas                      1.0                         mkl
[conda] magma-cuda92              2.4.0                         1    pytorch
[conda] mkl                       2018.0.3                      1
[conda] mkl-include               2019.1                      144
[conda] mkl_fft                   1.0.6            py37h7dd41cf_0
[conda] mkl_random                1.0.1            py37h4414c95_1
[conda] mkldnn                    0.14.0                        0    mingfeima
[conda] torch                     1.0.0a0+db5d313           <pip>
```
## Additional context

While `model.save(f)` works fine for standalone jit.ScriptModule, I cannot find a way to save the entire `torch.nn.Module` containing `torch.jit.ScriptModule`, and it seems like a bug that I cannot use `torch.save` for the case.
Repository: TypeScript
Issue: Docs: Advanced Types section "Interfaces vs. Type Aliases" is contradictory
Labels: Docs

**TypeScript Version:**  N/A

**Search Terms:**
label: Docs "Advanced Types" "Interfaces vs Type Aliases"

I've been trying to understand the differences between interfaces and type aliases, and I've found contradictory information on the ["Advanced Types"](https://www.typescriptlang.org/docs/handbook/advanced-types.html) page of the docs. The "Type Aliases" section begins with "Type aliases create a new name for a type." Just a few paragraphs later though in the "Interfaces vs. Type Aliases" subsection, it says: "Type aliases **don’t** create a new name". (Emphasis is mine). See also [this blog post](https://medium.com/@martin_hotell/interface-vs-type-alias-in-typescript-2-7-2a8f1777af4c), which enumerates some other aspects of this section that would benefit from clarification/update.
Repository: You-Dont-Know-JS
Issue: ch6: Benchmarking | Use console.time()
Labels: for second edition

https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch6.md#benchmarking

You could use the built-in `console.time()` and `console.timeEnd()` in this benchmarking example, as the `console` offers many more options than just `log()`. https://developer.mozilla.org/en-US/docs/Web/API/Console/time

```
console.time()

// do some operation

console.timeEnd()

// default: 4886.283ms
```
Repository: rust
Issue: False dead_code warning on struct pattern match
Labels: A-lints,T-compiler,C-bug

The following code will emit a `dead_code` warning ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=5c94d6fd6a0bf1512d68495aedbd1b82)):

```rust
use std::mem;

fn main() {
    struct Value {
        a: i32,
        b: i32,
    };

    let Value { a, b } = unsafe { mem::zeroed() };
    println!("{} {}", a, b);
}
```

It states that `Value` is never constructed when in fact it has been within the `let Value { a, b }` pattern match.

```
   Compiling playground v0.0.1 (/playground)
warning: struct is never constructed: `Value`
 --> src/main.rs:4:5
  |
4 |     struct Value {
  |     ^^^^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

    Finished dev [unoptimized + debuginfo] target(s) in 0.90s
     Running `target/debug/playground`
```
Repository: TypeScript
Issue: Remote declaration file
Labels: Suggestion,Awaiting More Feedback

## Search Terms

- Remote Reference
- Remote Declaration
- Declaration URL 

## Suggestion

Being able to reference .d.ts files from a remote location

## Use Cases

Reference .d.ts files which can match with import "http://example.com/Component1"

## Examples
```typescript
/// <referance path="http://example.com/Definitions/Component1" />
import "http://example.com/Component1"
```

## Checklist

My suggestion meets these guidelines:

* [ ] 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.)
* [ ] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).