sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: x/tools/cmd/goimports: lost line between package and import statements in output
Labels: help wanted,NeedsFix,Tools

Please answer these questions before submitting your issue. Thanks!

### What version of Go are you using (`go version`)?

go version go1.10.3 linux/amd64

### Does this issue reproduce with the latest release?

Yes with go1.10.3 and the following commits:

```
golang.org/x/tools/imports: 8cb83b71b42ccf5fe279fa8a24a6a8f65507dc9c
golang.org/x/tools/cmd/goimports: 059bec968c61383b574810040ba9410712de36c5
```

### What operating system and processor architecture are you using (`go env`)?

```
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/legers/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/legers/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build017712154=/tmp/go-build -gno-record-gcc-switches"
```

### What did you do?

Very similar to issue  #26290, but no initial import statement.

```
$ cat x.go
package p // comment

// T does something useful.
func T() {
    var _ = fmt.Printf
}

$ goimports x.go
package p // comment

import "fmt" // T does something useful.
func T() {
	var _ = fmt.Printf
}
```
A blank line should have been inserted after the new import statement.
Repository: flutter
Issue: Horizontal Stepper with addition and removal of Steps
Labels: c: new feature,framework,f: material design,P3,team-design,triaged-design

Feature Request: 
* Need a way to add and remove steps from Stepper
* Need a better implementation for Horizontal stepper type

The issue, appears to be in the TODO list of Stepper.dart for a long time. The issue hasn't seen any update in a while, and seems to be left behind. It would be a great leap, if the hardcoded stepper.dart is made more developer friendly. 

[Take a look at Stepper.dart, Stepper implementation code](https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/stepper.dart)
Repository: neovim
Issue: ":silent !echo 1" does not display anything (unlike Vim)
Labels: compatibility,terminal

Given t.vim:

```vim
silent !echo 1 1>&2
```

`nvim -Nu t.vim -cq` will not output anything, unlike Vim.

The `:silent` is required with Vim to not display the `:!` command, and to not cause a hit-ENTER prompt.

This is used by Vader to display test results.

It makes no difference to use `--headless`.

I've been using `writefile(lines, '/dev/stderr', 'a')` as a workaround for now (via $VADER_OUTPUT_FILE), but that does not work on Windows (tried "CON" for example).

Without the `:silent` Vim displays:
```
:!echo 1 1>&2
             1

Press ENTER or type command to continue
```

And Neovim (requires `--headless`; `nvim -u NONE -c ':!echo 1 >&2' -cq --headless`):
```
:!echo 1 >&2

1
```

Any suggestions for writing to Windows console (without going through a real file that needs to be `type`ed then)?

NVIM v0.3.2-77-g2b9fc9a13
Repository: godot
Issue: rect_size of Control node with tool script is (0, 0) in _ready
Labels: enhancement,documentation

**Godot version:**
3.0.6



**Issue description:**

The value of rect_size of a Control node is (0, 0) in _ready when it is called in a tool script.
Repository: rust
Issue: libc and test features are special-cased for feature validity checks
Labels: C-cleanup

When implementing https://github.com/rust-lang/rust/pull/52644, where we emit errors when using unknown features, I had to special case two features: `libc` and `test`, because they weren't being picked up (and there were time constraints).

The special-casing is here:
https://github.com/rust-lang/rust/blob/0aa8d0320266b5579428312095fe49af05ada972/src/librustc/middle/stability.rs#L840-L847
- `libc` is declared unlike any other feature:
https://github.com/rust-lang/libc/blob/6bdbf5dc937459bd10e6bc4dc52b0adbd8cf4358/src/lib.rs#L92-L94
so it's not entirely surprising that the detection overlooks it, but I didn't find the root cause.
- I didn't manage to figure out what makes `test` special.

Ideally these should both not be special-cased. The relevant code for feature collection is in `src/librustc/middle/lib_features.rs`, so that's a good place to start looking.
Repository: TypeScript
Issue: Autocomplete fails on inferred type
Labels: Bug,Domain: Completion Lists


**TypeScript Version:**  3.1.0-dev.20180810

**Search Terms:** Autocomplete inferred 

**Code**
```typescript
type ValueTypes = 1 | 2 | 3;

export type RecordValues<Props extends string | number | symbol> = Record<
  Props,
  ValueTypes
>;

export function identityFn<RV extends RecordValues<keyof RV>>(value: RV) {
  return value;
}

const recordValue: RecordValues<"asdf"> = {
  asdf: 2 //Autotcomplete works fine for the value here
};

identityFn({
  asdf: 1 //Autocomplete shows every type available
});
```
**Expected behavior:** 

For the autocomplete for the value on the second comment to be the same as the first.
Please note I'm not talking about the keys but the values.

**Actual behavior:**

Autocomplete for the value suggests every type available.

**Playground Link:**  [link](https://www.typescriptlang.org/play/#src=type%20ValueTypes%20%3D%201%20%7C%202%20%7C%203%3B%0D%0A%0D%0Aexport%20type%20RecordValues%3CProps%20extends%20string%20%7C%20number%20%7C%20symbol%3E%20%3D%20Record%3C%0D%0A%20%20Props%2C%0D%0A%20%20ValueTypes%0D%0A%3E%3B%0D%0A%0D%0Aexport%20function%20identityFn%3CRV%20extends%20RecordValues%3Ckeyof%20RV%3E%3E(value%3A%20RV)%20%7B%0D%0A%20%20return%20value%3B%0D%0A%7D%0D%0A%0D%0Aconst%20recordValue%3A%20RecordValues%3C%22asdf%22%3E%20%3D%20%7B%0D%0A%20%20asdf%3A%202%20%2F%2FAutotcompletion%20works%20fine%20here%0D%0A%7D%3B%0D%0A%0D%0AidentityFn(%7B%0D%0A%20%20asdf%3A%201%20%2F%2F%20Try%20autocomplete%20here%0D%0A%7D)%3B%0D%0A)
**Related Issues:** #14841
Repository: rust
Issue: specialize clone_from_slice for Copy types?
Labels: C-enhancement,T-libs-api

Just found that `clone_from_slice` emits worse code for `Copy` types than necessary. Wonder if it's possible to specialize it to emit the same code as `copy_from_slice`.
Repository: godot
Issue: range with 0 step won't raise error when used in for loop
Labels: bug,topic:gdscript,confirmed

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot/OS version:**
<!-- Specify commit hash if non-official. -->
a71a5fc Manjaro x86_64

**Issue description:**
<!-- What happened, and what was expected. -->
Expected: debugger to stop the execution on line with following code:
```gdscript
for i in range(0,2,0):
```
because the following line stops the execution
```gdscript
print(range(0,2,0))
```
with this error
```
Error calling built-in function 'range': step argument is zero!
```
Happened: fails silently

**Steps to reproduce:**
New node with this script
```gdscript
extends Node
func _ready():
	for i in range(0,2,0):
		pass
```
the execution continues. inner block is never executed.
Repository: rust
Issue: diagnostics: suggest using smaller type if constant is small enough and smaller type impls conversion
Labels: C-enhancement,T-compiler,A-suggestion-diagnostics

this code
````rust
fn main() {
    let x = 123.1234_f32 - f32::from(100);
}
````
fails to compile as follows:
````rust
error[E0277]: the trait bound `f32: std::convert::From<i32>` is not satisfied
 --> src/main.rs:2:28
  |
2 |     let x = 123.1234_f32 - f32::from(100);
  |                            ^^^^^^^^^ the trait `std::convert::From<i32>` is not implemented for `f32`
  |
  = help: the following implementations were found:
            <f32 as std::convert::From<u8>>
            <f32 as std::convert::From<i16>>
            <f32 as std::convert::From<u16>>
            <f32 as std::convert::From<i8>>
  = note: required by `std::convert::From::from
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
````
We know that ````100 < <u8>::max_value()````and that there is ```` <f32 as std::convert::From<u8>>```` thus maybe we could suggest using ````f32::from(100_u8)```` instead?
Repository: pytorch
Issue: [caffe2] enforce fail at context_gpu.cu:285, cannot get GPU memory usage statistics
Labels: caffe2

## Issue description
enforce fail at context_gpu.cu:285, cannot get GPU memory usage statistics

## Code example
from caffe2.python import utils
mem_stats = utils.GetGPUMemoryUsageStats()

WARNING: Logging before InitGoogleLogging() is written to STDERR
W0811 21:28:20.350441 28545 init.h:99] Caffe2 GlobalInit should be run before any other API calls.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/utils.py", line 245, in GetGPUMemoryUsageStats
    device_option=core.DeviceOption(caffe2_pb2.CUDA, 0),
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 165, in RunOperatorOnce
    return C.run_operator_once(StringifyProto(operator))
RuntimeError: [enforce fail at context_gpu.cu:285] FLAGS_caffe2_gpu_memory_tracking. Pass --caffe2_gpu_memory_tracking to enable memory stats Error from operator: 
output: "____mem____" name: "" type: "GetGPUMemoryUsage" device_option { device_type: 1 cuda_gpu_id: 0 }

## System Info
- PyTorch or Caffe2: Caffe2
- How you installed PyTorch (conda, pip, source): source
- OS: Ubuntu 16.04
- CUDA/cuDNN version: 8.0 / 5.1
- GPU models and configuration: GTX 1080
- GCC version (if compiling from source): 5.1
Repository: rust
Issue: Feature Requst: Add regex support to test filters
Labels: T-libs-api,C-feature-request,A-libtest

## Proposal

I'd like to filter my tests based on a more complex pattern than just substring.  

The current behavior of rust tests is that when a pattern is specified, then only tests that contain that pattern as a substring are run.

`cargo test -- foo` will run only tests that contain the substring `foo`.

I propose to amend this to allow for a regex syntax.

`cargo test -- /regex/` which will run tests that match the regex `regex`.

This is "technically" a breaking change because it's possible that people are already using filters with slashes in them, but since test names can't contain slashes these invocations would always be running 0 tests.

# Misc
* Let me know if this should be an RFC.  The feature seems pretty small, but I'd understand if it should be more speced out.
* I'd be happy to implement this if people are interested.


<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

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

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: TypeScript
Issue: Incorrect "Cannot find name" when importing default value
Labels: Bug

<!-- 🚨 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.0.1

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** Cannot find name import default

**Code**

```ts
// fetch.d.ts
declare function fetch(url: string): Promise<any>;
export = fetch;
declare namespace fetch {
  export { fetch as default };
}

// index.ts
import f from "./fetch";
f("url"); // error TS2304: Cannot find name 'f'
```

**Expected behavior:** Name should be found

**Actual behavior:** Cannot find name. Interestingly `import { default as f } from "./fetch";` works.

**Playground Link:** (It doesn't support modules :/)

**Related Issues:** Couldn't find one
Repository: rust
Issue: Add a feature to print actual static libs linked in, --print=native-static-libs seems not to work
Labels: A-linkage,A-driver,T-compiler,C-feature-request

For Debian we need to keep track of static libs linked into a final binary, for copyright purposes.

It seems that `src/librustc_codegen_llvm/back/link.rs` performs the actual linking and search of paths, and it refers to a `--print=native-static-libs` option but this doesn't seem to work.

For example when I [link to the system libbacktrace](https://github.com/infinity0/backtrace-rs/commit/9cbfda1e96ea624991237c3ba48f398df741cd90) and then build this with `RUSTFLAGS="--print=native-static-libs" cargo build --verbose --verbose --verbose` I can see the build.rs output which is

~~~~
cargo:rustc-link-lib=static=backtrace
cargo:rustc-link-search=native=/usr/lib/gcc/x86_64-linux-gnu/7/
~~~~

But then I don't see any follow-up output that indicates that rustc actually found the file `/usr/lib/gcc/x86_64-linux-gnu/7/libbacktrace.a` and this was what was actually linked into the final `backtrace-sys.rlib`.
Repository: angular
Issue: pwa can't cache resource with space in url
Labels: type: bug/fix,effort1: hours,freq1: low,area: service-worker,state: confirmed,P3

<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.

ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## 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 -->
[ ] Performance issue
[ ] 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
[ ] Other... Please describe:
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
when where is a resources in assets directory, and filename includes space " ", the @angular/pwa service worker can't cache it correctly.

## Expected behavior
<!-- Describe what the desired behavior would be. -->


## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter).
-->
ng add @angular/pwa
put an image named "a b.jpg" in assets
reference it in html
ng build --prod

open it in browser
enable offline mode in chrome devtools
refresh page
it will got a 504.

## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->


## Environment

<pre><code>
Angular version: X.Y.Z
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [x] Chrome (desktop) version 68
- [ ] 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, ... -->
</code></pre>
Repository: TypeScript
Issue: Assignment of argument to argument loses deduced typing
Labels: Bug

Could be a duplicate but difficult to construct an issue search to discern.

Problem shows with `typescript@latest` version `3.0.1`.

Given nature of problem suspect that it would not have been fixed in `typescript@next`. Apologies for not testing.

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
type inference error argument

**Code**

```ts
// A *self-contained* demonstration of the problem follows...
// Just paste this code into your favorite TypeScript IDE
```
```
function foobar_good(arg: unknown): void | number {

  if (typeof arg != 'number') {
    return
  }

  return arg;
}

function foobar_bad(arg: unknown): void | number {

  if (typeof arg != 'number') {
    return
  }

  arg = arg;

  return arg;
}
```

> [ts] Type 'unknown' is not assignable to type 'number | void'.
  Type 'unknown' is not assignable to type 'void'.


**Expected behavior:**
Should compile.

**Actual behavior:**
Does not compile.
Repository: rust
Issue: Add a `skip` method to the `Read` trait
Labels: T-libs-api,C-feature-request

The [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) trait doesn't currently offer an optimal way to discard a number of bytes from the data source. Using the `bytes()` iterator requires you to evaluate a `Result` for each byte you discard and using `read_exact()` requires you to provide a buffer to unnecessarily fill.

This solution (borrowed from [a StackOverflow answer](https://stackoverflow.com/a/42247224/109549)) seems to work nicely:

```rust
let mut file = File::open("foo.txt").unwrap();

// Discard 27 bytes
io::copy(&mut file.by_ref().take(27), &mut io::sink());

// Read the rest
let mut interesting_contents = Vec::new();
file.read_to_end(&mut interesting_contents).unwrap();
```

I can put a PR together if you'd like.
Repository: TypeScript
Issue: No completions in global namespace augmentation from original namespace
Labels: Bug,Help Wanted,Domain: Completion Lists

**TypeScript Version:**  3.1.0-dev.20180810

**Code**

**a.d.ts**
```ts
declare namespace N {
	class A {}
}
```

**b.d.ts**
```ts
export {};
declare global {
	namespace N {
		class B extends N./**/ {}
	}
}
```

**Expected behavior:**

Completions at `/**/` are `A` and `B`.

**Actual behavior:**

Only get completion for `B`.
Repository: go
Issue: cmd/compile: recognize map-copy with range idiom
Labels: Performance,NeedsInvestigation,compiler/runtime

As @mvdan notes on the map clearing idiom issue #20138 there are more cases of the map copying pattern than there are cases of the map clearing pattern in the std library:
```
gogrep '~ $m2 = $_; $*_; for $k, $v := range $(m1 is(map)) { $m2[$k] = $v }' std cmd
```

map copy pattern:
```go
m2 := make(map[K]V)
for k, v := range m1 {
    m2[k] = v
}
```
This pattern and variations of it could be detected and made more efficient by avoiding (some) iteration overhead and allocating the new map to a sufficient size.

### Implementation Notes
Copying the backing array directly with memcpy (as analog to memclr in the map clearing pattern optimization) however would need to keep the internal hash seed of the two maps equal.  Given that there are no guarantees what the iteration order over maps is (not even that it can not be the same) from a language spec perspective that change seems backwards compatible. There is the possibility of leaking state (the seed) to other parts of a go implemented system and by learning something about collisions in the copied map now being able to infer collisions in the original map.

Another implementation caveat is that any values in overflow buckets will need to be copied too. In the map clear case they are currently ignored for clearing as the pointers to them will be removed and the overflow buckets are garbage collected. For a map copy however all overflow buckets will need to be processed too. The new overflow buckets could be bulk allocated. Depending on the complexity and performance gain the backing array and overflow buckets could be allocated in one allocation together.

A further aspect is that if the map is growing that growth would either need to finish first before copying the new bucket array (could be a lot of work) or the state of map growth with old and new bucket array would have to be copied too.

Note that map make + map copy issue is similar to slice make + slice copy/append #26252 and some of the infrastructure to detect the patterns could be reused for both optimizations. There is the possibility to make even more general compiler pass that detects making and overwriting more complex structures (that can not already be easily handled in ssa phase) to avoid unneeded memclr in the future. Slices and Maps directly seem like common enough and requested cases to specialize first in absence of a more general and likely more complex solution.

### Map Copying A Special Case Of Map Merging
A more general optimization to map patterns could be to detect any merge (where copy is a special case of m2 being empty):
```go
for k, v := range m1 {
    m2[k] = v
}
```
While this is easier to detect as a pattern (no compile time reasoning that m2 is empty needed) it is unclear if there are large performance gains that could be made in the non-copy case.

@josharian @khr @mvdan
Repository: angular
Issue: @angular/animations. incoherent and inconsistent behavior when animating divs
Labels: type: bug/fix,area: animations,freq2: medium,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 -->
[ ] Performance issue
[ ] 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
[ ] Other... Please describe:
</code></pre>

## Current behavior
I am playing around with the animation package and multiple points i have to raise here.
Please look at the stackblitz link provided to understand the bottom example.

For the exact same animation code (but with 2 different animation triggers):
. item red in an ngFor
. item yellow without ngFor

When you hit the button a first time
item red: move with animation (20px)
item yellow: move with animation (30px)

When you hit the button a second time
item red: move with animation from the beginning of the row (not from his current position) => **Problem1 (lost position)**
item yellow: move with NO animation from his current position to the new one => **Problem2 (lost animation)**

note:
When you uncomment only the line in the method `animSecondDone` the problem2 is solved. But it should not be needed in my opinion since `transition('* => moveYellowX', animate('1s linear'))` includes `moveYellowX to moveYellowX`.
Doing the same for red item=> when you uncomment only the line in the method `animDone`, it broke the animation of red Item totally **Problem3**.

**Problem4 => animation behave differently with/without ngFor**

I think all problems [1 to 4] mentioned should be fixed. Can you confirm that all these are problems?
(i didn't open one issue per problem but we can if you confirm and needed)

## Expected behavior
On each button click, item yellow and item red behave the same so move horizontally with animation.

## Minimal reproduction of the problem with instructions
check `Current behavior` section for instructions.
https://stackblitz.com/edit/angular-animations-poke-bugs?file=src/app/anim-test-a.component.ts

## What is the motivation / use case for changing the behavior?
Fixing the package.

## Environment
Angular V. => all in the stackblitz package.json

Browser:
- [x] Chrome (desktop) Version 68.0.3440.106 (Official Build) (64-bit)