sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: flutter
Issue: Provide a way to give Widgets negative spacing attributes.
Labels: c: new feature,framework,P3,team-framework,triaged-framework

Sometimes, it is desirable to give related Widgets negative spacing so that they appear closer together than they would being lined up in a Column. For example, if you build a Column of Text widgets with all-cap strings like "HELLO", there will be blank vertical space between each Text widget due to the ascender and descender of the font. With the ability to provide some kind of negative spacing or margin, you could correct for this.

Note that this is different from the other issue regarding the need for Ascender/Descender widgets. Non-Text widgets would benefit from negative spacing as well.
Repository: rust
Issue: inferrable lifetime not being removed by `cargo fix --edition --edition-idioms`
Labels: C-enhancement,A-lints,A-diagnostics,T-compiler,A-suggestion-diagnostics,A-edition-2018

https://github.com/amethyst/amethyst/blob/863b795ddf76a27107334f15113b5da8323b5207/src/state.rs#L30

This requirement can be inferred in Rust 2018 however the fix tool is not automatically removing it.
Repository: vscode
Issue: Interactive Diagnostics 
Labels: feature-request,api,under-discussion,languages-diagnostics

## Problem
JS and TS diagnostic messages can get quite large, especially when dealing with frameworks like Vue or react.   The TS team has worked to significantly improve and shorten diagnostic messages, including replacing complex type information with `...`, however there are still cases where you need to see the full type information. Right now, we have to staticly choose to expand the additional information or not. They would like the user to be able to interactively expand types within a diagnostic

In addition, the overall diagnostic experience could be improved. Two areas identified talking with the TS team:

* Syntax coloring of inline code in diagnostics
* Go to definition in diagnostics

## Refs
#11847

## Desired User Experience
Consider a diagnostic message  `T<...>`. We would like the `...` to be something like a  link. Clicking it would expand the diagnostic message to `T<Array<...>>`, which itself contains another expandable link

## Requirements
The main focus is on being able dynamically to expand sections of a diagnostic. We need new VS Code API support for this and then will need languages to adopt this API. However, I think the other two features should be considered while designing the new diagnostics API as they are likely something we would like to support and will influence overall api design 

For expansion, we want to be able to:

- Mark arbitrary spans within a diagnostics as expandable
- Lazily compute these expansions, i.e. don't resolve the expansions ahead of time
- Allow expansions to contain other expansions
- Show a progress indicator of some kind while an expansion is being resolved

Many of these features also make sense for quick info hovers
Repository: rust
Issue: Tracking issue for future-incompatibility lint `incorrect_macro_fragment_repetition`
Labels: A-lints,A-parser,A-macros,T-lang,T-compiler,C-future-incompatibility,C-tracking-issue,S-tracking-unimplemented

> [!IMPORTANT]
> This lint has not been implemented yet! See #55373.

### Status

- [x] Preliminary implementation started (#55373)
- [ ] Preliminary implementation available
- [ ] Stabilization proposed
- [ ] Stabilized

### Known bugs

None.

### Unresolved questions to be answered before stabilization

- When should we move from allow by default to warn by default to deny by default.
Repository: TypeScript
Issue: Pick<T, Exclude<keyof T, K>> & Pick<T, Extract<keyof T, K>> should be assignable to T
Labels: Suggestion,Experience Enhancement,Domain: Conditional Types

**TypeScript Version:**  3.2.1

**Search Terms:**
3.2.1
extends
intersection generic

**Code**

```ts
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

type Func<T> = (arg: T) => null

type Context = 'Context';

export function withRouteContextPropConsumer<
    T extends { routeContext: Context }
>(
    funcToWrap: Func<T>,
): Func<Omit<T, "routeContext">> {
    return (args: Omit<T, "routeContext">) => {
        const routeContext: Context = 'Context';
        return funcToWrap({ ...args, routeContext });
    };
}
```

**Expected behavior:**
Code compiles without errors

**Actual behavior:**
```
Argument of type '{ routeContext: "Context"; }' is not assignable to parameter of type 'T'.
```

**Playground Link:** http://www.typescriptlang.org/play/#src=type%20Omit%3CT%2C%20K%20extends%20keyof%20T%3E%20%3D%20Pick%3CT%2C%20Exclude%3Ckeyof%20T%2C%20K%3E%3E%3B%0A%0Atype%20Func%3CT%3E%20%3D%20(arg%3A%20T)%20%3D%3E%20null%0A%0Atype%20Context%20%3D%20'Context'%3B%0A%0Aexport%20function%20withRouteContextPropConsumer%3C%0A%20%20%20%20T%20extends%20%7B%20routeContext%3A%20Context%20%7D%0A%3E(%0A%20%20%20%20funcToWrap%3A%20Func%3CT%3E%2C%0A)%3A%20Func%3COmit%3CT%2C%20%22routeContext%22%3E%3E%20%7B%0A%20%20%20%20return%20(args%3A%20Omit%3CT%2C%20%22routeContext%22%3E)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20const%20routeContext%3A%20Context%20%3D%20'Context'%3B%0A%20%20%20%20%20%20%20%20return%20funcToWrap(%7B%20...args%2C%20routeContext%20%7D)%3B%0A%20%20%20%20%7D%3B%0A%7D
**Related Issues:** Nothing obvious

After upgrading from 3.0.3 to 3.2.1, it seems that tsc has (at least partially) lost the ability to reason about constrained generics.

In the example above (one of our React context helper functions, modified to remove the React dependency), the function is parameterised over a constrained generic:
```ts
T extends { routeContext: Context }
```

But a few lines later, the compiler complains that the generic `T` may not have a `routeContext` attribute. T *must* have a `routeContext` attribute however, because of the constraint. Perhaps the `Omit` helper is confusing things?
Repository: angular
Issue: Router state is Mutable via ActivatedRouteSnapshot
Labels: area: router,P3

# 🐞 bug report

### Affected Package
@angular/router (probably)


### Is this a regression?
No. It appears to have existed for a while. See #17609 


### Description
If you mutate existing properties on the queryParams object of an ActivatedRouteSnapshot without making a deep copy, it appears to mutate the router's internal state. Telling the router to navigate using the mutated queryParams object does not trigger a navigation event in this case.


## 🔬 Minimal Reproduction
https://stackblitz.com/edit/github-powged?file=src%2Fapp%2Freproduction%2Freproduction.component.ts
Repository: pytorch
Issue: [discussion] Recommend a different file extension for models (.PTH is a special extension for Python)
Labels: triaged

*.pth files are used by Python to list additional package search paths: https://docs.python.org/3/library/site.html

The pth files will be loaded as text files by Python interpreter. At some point when I had some PyTorch model pth file placed along with the sources, it caused a hang of Python at startup (it was trying to parse the big binary file as a list of paths).

Maybe just *.pt?
Repository: pytorch
Issue: [C++/Pytorch] Get input shapes
Labels: oncall: jit

Is there a way to get the input shapes from ```torch::jit::script::Module```? For example, if we want to resize the input image to the correct shape to perform classification using the traced module, we need this information.
Repository: go
Issue: cmd/go: packages that use cgo not cached when cross-compiling android .so file
Labels: ToolSpeed,NeedsInvestigation

Here is my build command (fast in go1.9.2), I used goroutines and waitgroup to make it build two android cpu arch in two processes to make it faster:
```
go build -buildmode=c-shared -i -pkgdir /xxx/pkg/android_386_shared -tags "android linux" -ldflags "-s -w" -gcflags=-trimpath=/xxx/ -o=bin/jniLibs/x86/libxxx.so xxx/xxx
go build -buildmode=c-shared -i -pkgdir /xxx/pkg/android_arm_shared -tags "android linux" -ldflags "-s -w" -gcflags=-trimpath=/xxx/ -o=bin/jniLibs/arm/libxxx.so xxx/xxx
```

My computer os is mac os 10.13.6
My program use cgo and it have a lot of c source code (sqlite3,"github.com/mutecomm/go-sqlcipher")
During all step I will not delete/modify the result .so files.
before first time run in go1.11.2, i will use `rm -rf /Users/xxx/Library/Caches/go-build && rm -rf ./pkg && rm -rf ./bin` to clean all build cache.
before first time run in go1.9.2, i will use `rm -rf ./pkg && rm -rf ./bin` to clean all build cache.
after first time run and before second time run, I will not change any code.
after second time run and before third time run, I will change one comment in the main package. 

build time with go1.11.2
========
* first 1m15.48132439s
* second 44.123888335s
* third 46.841824535s

build time with go1.9.2
========
* first 1m15.187967573s
* second 5.208278504s
* third 3.91962979s

What I have already tried
========
Looks like I have already did what i can do to make the build faster in the command line without read the actually build source code to find some hidden faster flag.
* I have tried `go install -buildmode=c-shared xxx`, it will not faster.
* I have tried do not pass -pkgdir parameters, it will not faster.
* I have tried do not pass -i parameters, it will not faster.
* I have tried add -ldflags "-s -w", it save me about 20s in golang1.11.2, so I add in my program.

My build script to cross build .a file (-buildmode=c-archive) to ios(darwin arm64) have the same problem.
My build script to cross build elf file to (linux,amd64) become faster in go1.11.2 than go1.9.2.
I guess the build cache part of cross build android/ios or (-buildmode=c-archive) or (-buildmode=c-shared) have been delete.
Currently, I have to stop upgrade to newer golang version forever if I want develop my android/ios app faster.

So My problem is What command line should I use, if I want faster corss build to android with go1.11.2?
Repository: TypeScript
Issue: Dynamic TagName causing error after version upgrade
Labels: Bug,Domain: JSX/TSX

typescript version: 3.2.2
IDE: VS Code

Description:
I updated from v3.1.6 to v3.2.2. This is my code:

```
import * as React from 'react';

export interface Props {
  tag?: string,
};

const MyComponent: React.FunctionComponent<Props> = ({
  tag: Tag = 'div', children
}) => {
  return (
    <Tag> // this is causing the error
      {children}
    </Tag>
  );
};

```

Expected:
No error

Actual:
Error produced:
`[ts] Type '{ children: ReactNode; }' has no properties in common with type 'IntrinsicAttributes'. [2559]`

This seems like a regression as it worked in v3.1.6
Repository: TypeScript
Issue: is out-of-bounds in tuple of length，but the introduction in the document can be out of bounds
Labels: Docs

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

I think this should be the document not updated，Please update the official documentation，Because it makes people confused
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.2.0
**Code**
This is the official demo

```ts
// Declare a tuple type
let x: [string, number];
// Actually，this code will throw error
x[3] = 'world'; // OK, 'string' can be assigned to 'string | number'
```

**Expected behavior:**
I want to know if this is a bug or this is document error

**Actual behavior:**
Tuple out of bounds will trow error, but document say `When accessing an element outside the set of known indices, a union type is used instead`

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
https://www.tslang.cn/play/index.html#src=let%20x%3A%20%5Bstring%2C%20number%5D%3B%0D%0A%2F%2F%20When%20accessing%20an%20element%20outside%20the%20set%20of%20known%20indices%2C%20a%20union%20type%20is%20used%20instead%3A%0D%0A%2F%2F%20Actually%EF%BC%8Cthis%20code%20will%20throw%20error%0D%0Ax%5B3%5D%20%3D%20%22world%22%3B%20%2F%2F%20OK%2C%20'string'%20can%20be%20assigned%20to%20'string%20%7C%20number'

![image](https://user-images.githubusercontent.com/16078260/49633633-135ef100-fa35-11e8-8013-067ba8f932d9.png)


**Related Issues:** <!-- Did you find other bugs that looked similar? --> NO
Repository: TypeScript
Issue: "2 definitions" returned when defaultProps exists in JS component.
Labels: Bug,Domain: Symbol Navigation

VSCode Version: 1.29.1
tsc Version: Version 3.3.0-dev.20181206
OS Version: macOS 10.14.1

> Test.js
![image](https://user-images.githubusercontent.com/20541303/49632344-5074b480-fa30-11e8-9bbf-bbf130e744a4.png)

> TestOuter.js
![image](https://user-images.githubusercontent.com/20541303/49633212-794a7900-fa33-11e8-8d92-e3743ea83dcb.png)


In the above code, when i click `TestCom`, "2 definitions" pop up in Test Component like the below image, it's too annoying to close it everytime i go to definition.

> Test.js
![image](https://user-images.githubusercontent.com/20541303/49633121-25d82b00-fa33-11e8-9326-b73c98ea3248.png)

but when i use brackets wrapping Test component, or don't use `Test.xxx = ooo`,there is no "2 definitions" pop up.
> Test.js
![image](https://user-images.githubusercontent.com/20541303/49633378-1ad1ca80-fa34-11e8-8687-3d95a014e967.png)
![image](https://user-images.githubusercontent.com/20541303/49633440-4b196900-fa34-11e8-9eee-20718096fdec.png)

i have used latest version of typescript, is there any sufficient ways to solve this?
Repository: godot
Issue: Thin lines are not rendered correctly if rendering at a scale factor lower than the default
Labels: bug,discussion,topic:rendering,confirmed,topic:gui,topic:2d

**Godot version:**
<!-- Specify commit hash if non-official. -->
Godot 3.1 master 21dea10, Godot 2.1.5

**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
Xubuntu 16.04.5 LTS, Nvidia GTX 750 Ti, proprietary driver ver. 390.87

**Issue description:**
<!-- What happened, and what was expected. -->
When used 2d/viewport mode thin lines not rendered correctly.
It's affected LineEdit caret.
![thin_lines](https://user-images.githubusercontent.com/1049442/49637616-14d9ea80-fa30-11e8-96de-2ac7a390a760.gif)

**Steps to reproduce:**
1) Open attached project.
2) Run scene.
3) Some lines invisible.

**Minimal reproduction project:**
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
For Godot 3.1: [thin_lines.zip](https://github.com/godotengine/godot/files/2656533/thin_lines.zip)
Repository: go
Issue: x/text: avoid double execution of lookup in lookupAndFormat()
Labels: Performance,NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.11.2 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

- This is the latest release.
- code is identical in the master branch

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fgm/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/fgm/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build766242374=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->
- Prepare a simple app with exported strings using `//go:generate gotext -srclang=en update -out=catalog/catalog.go -lang=fr`
- Invoke p.Printf("Hello, world") and debug what happens, until stepping into `message.lookupAndFormat()` until this fragment:
```go
	if p.catContext.Execute(id) == catalog.ErrNotFound {
		if p.catContext.Execute(msg) == catalog.ErrNotFound {
			p.Render(msg)
			return
		}
```
### What did you expect to see?

- since in most cases `id == msg`, skip the second execution of `p.catContext(msg)` if the first execution returned `catalog.ErrNotFound`

### What did you see instead?

- if `p.catContext.Execute(id)` returned `catalog.ErrNotFound`, code performs the same work a second time as `p.catContext.Execute(msg)`
- which could be avoided by checking whether `id == msg`, maybe like:

```go
	if p.catContext.Execute(id) == catalog.ErrNotFound {
		if id == msg || p.catContext.Execute(msg) == catalog.ErrNotFound {
			p.Render(msg)
			return
		}
	}
```
Repository: vscode
Issue: Using OS user name / git user name inside code snippets
Labels: help wanted,feature-request,snippets

I'd like to add the following code snippet and share it with the whole team:

```json
{
  "Comment todo": {
    "prefix": "//",
    "body": [
        "// TODO (${MY_NAME}) [${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}]: $1"
    ]
  }
}
```

This should produce `// TODO (Alexander Kachkaev) [2018-12-07]: ...` on my computer and `// TODO (John Smith) [2018-12-07]: ...` on John Smith's.

Looking at [VSCode snippet docs](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_variables) and [VSCode variable reference](https://code.visualstudio.com/docs/editor/variables-reference) does not suggest that there is any variable like `MY_NAME`. Could it be added? The value can either be taken from the OS user name or from the git user name. Similarly, there could be a variable for the current user's email address (possibly taken from the git config).

WDYT?
Repository: TypeScript
Issue: Partial type for reduce initialValue
Labels: Suggestion,Awaiting More Feedback


## Search Terms

reduce initialvalue partial type assertion

## Suggestion

Add a signature to the type for `Array.reduce<U>` to allow the initialValue to be a `Partial<U>`

## Use Cases

Many cases where the reduce function is used to build an object that will eventually conform to `U`, but starts with an empty accumulator.

## Examples

Simple example where the initialValue does not satisfy `U` but the final result will:
```ts
['one'].reduce<{ one: string }>((acc, i) => ({ [i]: i, ...acc }), {})
```

This yields

> Argument of type '{}' is not assignable to parameter of type '{ one: string; }'.
>  Property 'one' is missing in type '{}' but required in type '{ one: string; }'.

Calling the function without an initialValue causes problems because the initialValue needs to be an object for this to work.

The below type signature would fix this issue:
```ts
interface Array<T> {
  reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: Partial<U>): U;
}
```

## 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.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: rust
Issue: Coercing &mut to *const should not create a shared reference
Labels: T-lang,A-raw-pointers,I-lang-radar

It has long been a rule in Rust that you must not mutate through a shared reference, or a raw pointer obtained from a shared reference.

Unfortunately, that rule currently forbids the following code:
```rust
fn direct_mut_to_const_raw() {
    let x = &mut 0;
    let y: *const i32 = x;
    unsafe { *(y as *mut i32) = 1; }
    assert_eq!(*x, 1);
}
```
The reason for this is that coercing `&mut T` to `*const T` implicitly first creates a shared reference and then coerces that to `*const T`, meaning `y` in the example above is technically a raw pointer obtained from a shared reference.

We should fix our coercion logic to no longer create this intermediate shared reference.

See https://github.com/rust-lang/rust/pull/56161 for how we uncovered this problem.

Cc @eddyb @nikomatsakis
Repository: rust
Issue: Error using associated constant in return type of generic function
Labels: A-associated-items,T-lang,T-compiler

Consider the following code:

```rust
trait ArrayGenerator {
  const LEN: usize;
}

fn generate<T>(obj: T) -> [u8; T::LEN] where T: ArrayGenerator {
  [0; T::LEN]
}

struct Foo { }

impl ArrayGenerator for Foo {
  const LEN: usize = 8;
}

fn main() {
  println!("{:?}", generate(Foo{}));
}
```

The compiler will error with:

```
error[E0599]: no associated item named `LEN` found for type `T` in the current scope
 --> src/main.rs:5:32
  |
5 | fn generate<T>(obj: T) -> [u8; T::LEN] where T: ArrayGenerator {
  |                                ^^^^^^ associated item not found in `T`
  |
  = help: items from traits can only be used if the trait is implemented and in scope
  = note: the following trait defines an item `LEN`, perhaps you need to implement it:
          candidate #1: `ArrayGenerator`
```

Now there is a clear constraint on T, meaning that LEN should be valid. I'm guessing the return type is being evaluated before the constraint, whereas it should check after, at which point it would know this this ought to be valid.

Tested in 1.31 stable and 1.32 nightly (Dec 7 2018)