sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: flutter
Issue: default Text widget's letter spacing is a bit off
Labels: framework,a: fidelity,f: cupertino,a: typography,has reproducible steps,P2,found in release: 3.7,team-design,triaged-design

<img width="460" alt="screen shot 2018-10-02 at 8 26 51 pm" src="https://user-images.githubusercontent.com/43219386/46374971-ad936900-c681-11e8-9bd5-243a7df87c8b.png">

The flutter's line seems to be a bit more spaced out, what do you think?

## Steps to Reproduce

Create two views, one in flutter with 
```dart
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'my_app',
      home: Scaffold(
        backgroundColor: Colors.white,
        body: Center(
          child: Text(
            'hello from flutter yay',
            style: TextStyle(
              fontSize: 18.0,
              fontWeight: FontWeight.w400,
              color: Colors.black,
            ),
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {},
          child: Icon(Icons.add),
        ),
      ),
    );
  }
}
```
and one in swift / objc with
```swift
  override func viewDidLoad() {
    super.viewDidLoad()
    view.backgroundColor = .white

    let helloLabel = UILabel()
    helloLabel.text = "hello from ios"
    helloLabel.translatesAutoresizingMaskIntoConstraints = false
    view.addSubview(helloLabel)
    helloLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
    helloLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
  }
```
Repository: TypeScript
Issue: CLI-only error calling generic function
Labels: Bug,Domain: Mapped Types

**TypeScript Version:**  3.2.0-dev.20181002

**Code**

```ts
function getFirst<K extends string, T>(obj: Record<K, ReadonlyArray<T>>, key: K): T {
	return obj[key][0];
}

interface I {
	readonly n: ReadonlyArray<number>;
	readonly s: ReadonlyArray<string>;
}

function f(i: I): number {
   return getFirst(i, "n");
}
```

**Expected behavior:**

No error.

**Actual behavior:**

No error in the editor.
Error on the command line:
```
src/a.ts:11:20 - error TS2345: Argument of type 'I' is not assignable to parameter of type 'Record<"n", ReadonlyArray<string>>'.
  Types of property 'n' are incompatible.
    Type 'ReadonlyArray<number>' is not assignable to type 'ReadonlyArray<string>'.
      Type 'number' is not assignable to type 'string'.

11    return getFirst(i, "n");
```

**Related Issues:** #19686
Repository: rust
Issue: `Sync` should imply `RefUnwindSafe` - lots of missing impls
Labels: T-libs-api,C-feature-request

`Sync` is a strictly stronger requirement on a type than `RefUnwindSafe`, because any type which can be accessed concurrently by multiple threads, can also be accessed after one of those threads panics.

However, if you compare the list of implementations for `Sync`:
https://doc.rust-lang.org/std/marker/trait.Sync.html#implementors

And those for `RefUnwindSafe`:
https://doc.rust-lang.org/std/panic/trait.RefUnwindSafe.html#implementors

There are clearly a lot missing.

Here's my best guess at some missing implementations:

```rust
impl RefUnwindSafe for Waker {}
impl RefUnwindSafe for std::sync::Once {}
impl RefUnwindSafe for std::sync::Condvar {}
impl<'a, T: ?Sized + Sync> RefUnwindSafe for MutexGuard<'a, T> {}
impl<'a, T: ?Sized + Sync> RefUnwindSafe for RwLockReadGuard<'a, T> {}
impl<'a, T: ?Sized + Sync> RefUnwindSafe for RwLockWriteGuard<'a, T> {}
impl<T> RefUnwindSafe for JoinHandle<T> {}
```

It's likely I've missed some where `Sync` is automatically implemented because of an explicit `Sync` implementation on a private type which has impacted automatic trait implementation. (Condvar was one of these)
Repository: rust
Issue: Poor Trailing Semicolon Error in -> impl Trait Function
Labels: E-hard,C-enhancement,A-diagnostics,P-medium,A-closures,T-compiler,A-suggestion-diagnostics

The diagnostics that check whether the concrete return type of an `-> impl Trait` function meets the `: Trait` bound should special-case the error when the concrete type is `()` to suggest removing the semicolon. Without this, the errors for a misplaced semicolon are misleading:

Without `impl Trait`:
```rust
trait Bar {}
impl Bar for u8 {}
fn foo() -> u8 {
    5;
}
```
```
error[E0308]: mismatched types
 --> src/main.rs:3:16
  |
3 |   fn foo() -> u8 {
  |  ________________^
4 | |     5;
  | |      - help: consider removing this semicolon
5 | | }
  | |_^ expected u8, found ()
  |
  = note: expected type `u8`
             found type `()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: Could not compile `playground`.
```

With `impl Trait`:
```rust
trait Bar {}
impl Bar for u8 {}
fn foo() -> impl Bar {
    5;
}
```
```
error[E0277]: the trait bound `(): Bar` is not satisfied
 --> src/main.rs:3:13
  |
3 | fn foo() -> impl Bar {
  |             ^^^^^^^^ the trait `Bar` is not implemented for `()`
  |
  = note: the return type of a function must have a statically known size

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `playground`.
```
Repository: TypeScript
Issue: `let foo = new Foo(); export = foo;` has fewer type errors than `export = new Foo();`
Labels: Bug

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.1.1 and 2.8.4

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** export = new instance

**Code**

store.ts:
```ts
class SetupStore {
  private _screenAfterScaleMitigation: string;

  constructor() {
    this._screenAfterScaleMitigation = 'FOO';
  }

  screenAfterScaleMitigation() {
    return this._screenAfterScaleMitigation;
  }
}
const setupStore = new SetupStore();
export = setupStore;
```
a.ts:
```
import * as SetupStore from './store';

console.log(SetupStore.screenAfterScaleMitigation());
```

tsconfig.json
```json
{
    "compilerOptions": {
        "allowJs": false,
        "moduleResolution": "node",
        "target": "es5",
        "importHelpers": false,
        "experimentalDecorators": true,
        "jsx": "react",
        "lib": ["dom", "es2015.promise", "es5"],
        "noImplicitAny": true,
        "noImplicitReturns": true,
        "noFallthroughCasesInSwitch": true,
        "noUnusedLocals": true,
        "noEmitOnError": true,
        "outDir": "./compiled",
        "preserveConstEnums": true,
        "rootDir": "./",
        "strictNullChecks": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "noImplicitThis": true
    }
}
```

**Expected behavior:**

an error like
```
a.ts:1:29 - error TS2497: Module '"/home/dgoldstein/tmp4/store"' resolves to a non-module entity and cannot be imported using this construct.

1 import * as SetupStore from './store';
```

**Actual behavior:**
This code typechecks, yet fails at runtime:

```
$ node compiled/a.js
/home/dgoldstein/tmp4/compiled/a.js:11
console.log(SetupStore.screenAfterScaleMitigation());
                       ^

TypeError: SetupStore.screenAfterScaleMitigation is not a function
    at Object.<anonymous> (/home/dgoldstein/tmp4/compiled/a.js:11:24)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
```

if the last two lines of `store.ts` are replaced with

```
export = new SetupStore();
```

then the expected error shows up.

**Playground Link:** requires multiple modules and --esModuleInterop so this isn't reproable in the playground

**Related Issues:** couldn't find any
Repository: flutter
Issue: Kernel files and snapshots contain absolute paths from developer's machine
Labels: engine,dependency: dart,P2,team-engine,triaged-engine

Tracking issue for dart-lang/sdk#34654

It appears that kernel files are capturing paths from the machine they were generated on. For example, I found this path in the kernel file and AOT compilation output of the android_alarm_manager example application: file:///usr/local/google/home/bkonyi/plugins/packages/android_alarm_manager/example/lib/main.dart

At the very least, fully qualified paths like this could add a number of KB to a shipped Flutter application and could be considered a privacy concern due to personally identifying information potentially being part of the path.

cc/ @Hixie @matthew-carroll
Repository: TypeScript
Issue: Write type parameters instead of @template tags in JSDoc
Labels: Suggestion,In Discussion,Domain: JSDoc,Experience Enhancement

Rather than

```js
/**
 * @typedef Arrayify
 * @type {{ [K in keyof T]: T[K][] }}
 * @template T
 */

/**
 * @typedef Bar
 * @type {{ x: string, y: number }}
 */

/**
 * @type {Arrayify<Bar>}
 */
var x;
```

I hate writing out the `@template` tag. Can we just write it out like this?

```js
/**
 * @typedef Arrayify<T>
 * @type {{ [K in keyof T]: T[K][] }}
 */

/**
 * @typedef Bar
 * @type {{ x: string, y: number }}
 */

 /**
  * @type {Arrayify<Bar>}
  */
var x;
```
Repository: rust
Issue: Using `include_str` in an attribute
Labels: T-lang,C-feature-request

Not sure if this should be an RFC or a bug/issue, but I'm trying to add an attribute to a struct where the value of the attribute is a `&'static str`. It would be nice to have the contents of the string in a separate file so I can have syntax highlighting when editing that file, and then have that be pulled in to the rust module and built. The following should reproduce the issue:

`Cargo.toml`:
```
[package]
name = "handmade-rs"
version = "0.1.0"
edition = "2018"

[dependencies]
winit = "0.17"
vulkano = "0.10.0"
vulkano-win = "0.10.0"
vulkano-shader-derive = "0.10.0"
```

And then in a module, try to compile the following. The `src` attribute takes a string as its value, that contains the source code of the shader to compile.

```
#[derive(VulkanoShader)]
#[ty="compute"]
#[src=include_str!("./compute_shader.glsl")]
pub struct Dummy;
```

When I compile, I get the following output:
```
$ cargo b
   Compiling handmade-rs v0.1.0 (C:\Users\Alexandros\workspace\handmade-rs)
error: expected `]`, found `!`
 --> src\shaders\compute.rs:4:18
  |
4 | #[src=include_str!("./compute_shader.glsl")]
  |                  ^ expected `]`

error: aborting due to previous error

error: Could not compile `handmade-rs`.

To learn more, run the command again with --verbose.
```
Repository: rust
Issue: Mapping `Ref` to a value containing a reference
Labels: T-libs-api,C-feature-request

Consider the following specific use case explaining a more general
issue: We have a struct, `RefStrings`, that keeps a `RefCell` containing
some form of collection, `Vec<String>`. Part of `RefStrings`'s API
surface is a function that aims to expose an iterator over the
underlying collection. The only possibility I see for exposing the
iterator (conceptually) is via a `Ref` and using `RefCell`'s `map`
function:

```rust
struct RefStrings(RefCell<Vec<String>>);

impl RefStrings {
    fn iter<'t, 's: 't>(&'s self) -> Ref<'t, Iter<String>> {
        Ref::map(self.0.borrow(), |x| x.iter())
    }
}
```
([playground](https://play.rust-lang.org/?gist=1e9b2b97db032b40e93e8bcbd7e2c70b&version=stable&mode=debug&edition=2015))

Unfortunately, that does not work. The reason being that `Ref` is
defined to hold a reference to a member of the borrowed object, but an
iterator is effectively an actual object in itself that just happens to
have such a reference.

I have not found a way to get this working using the existing
functionality. Am I just missing something?

A possible solution that I worked with now is the introduction of a new
associated function `Ref::map_val` that returns an object that
effectively contains another object (i.e., something that is `Sized`)
that may hold a reference to the borrowed data (e.g., a concrete
iterator type). That solves the problem reasonably nicely, in my
opinion.

```rust
struct RefStrings(RefCell<Vec<String>>);

impl RefStrings {
    fn iter<'t, 's: 't>(&'s self) -> RefVal<'t, Iter<String>> {
        Ref::map_val(self.0.borrow(), |x| x.iter())
    }
}

// ...
// RefVal is defined as:
pub struct RefVal<'b, T> {
    value: T,
    borrow: BorrowRef<'b>,
}
```
(see the [`cell` crate](https://crates.io/crates/cell) for the full functionality; note that the API provided is still limited, i.e., I mostly implemented what I needed right away)

Unfortunately I have not found a way to provide said functionality as
anything else than a replacement of `RefCell` itself, with all the code
duplication that accompanies.

So, I am filing this issue to discuss
1) whether I am just missing something and there is a trivial way to
   accomplish what I hopefully explained well enough
2) ~if that is not the case, whether this functionality is desired to be~
   ~included in the Rust standard library (I believe this is a general~
   ~problem with a general solution; despite probably not being a very~
   ~common one)~
3) ~if such a desire exists, the steps to be taken to include this~
   ~functionality (RFC process?)~

EDIT: [Proposed solution](https://crates.io/crates/cell) turned out to be unsafe with no known workaround. So really this issue is only to discuss other solutions.
Repository: pytorch
Issue: `GLIBC_2.23' not found on Ubuntu14.04.
Labels: caffe2

## Issue description

caffe2-cuda8.0-cudnn7 can't work on Ubuntu14.04.

## Code example

cd ~ && python -c 'from caffe2.python import core'
WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.
CRITICAL:root:Cannot load caffe2.python. Error: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.23' not found (required by /home/likewise-open/SENSETIME/wangyongwang/anaconda2/lib/python2.7/site-packages/caffe2/python/../../../../libcaffe2.so)

## System Info
- PyTorch or Caffe2: Caffe2
- How you installed PyTorch (conda, pip, source): conda
- Build command you used (if compiling from source): conda install -c caffe2 caffe2-cuda8.0-cudnn7
- OS: Ubuntu14.04
- PyTorch version: 
- Python version: 2.7.15
- CUDA/cuDNN version: 
- GPU models and configuration:
- GCC version (if compiling from source): 4.8
- CMake version:
- Versions of any other relevant libraries:
Repository: TypeScript
Issue: Assign a known symbol to a constant should retain type information
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.

-->

## Search Terms

<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

## Suggestion

<!-- A summary of what you'd like to see added or changed -->

Assigning a known symbol constant to another constant should retain type information.

```typescript
const foo = Symbol() // known symbol
const bar = foo // expecting 'typeof foo' but received 'symbol'

interface UseFoo {
  [foo]: 'value'
}

// This should work
const useBar: UseFoo = {
  [bar]: 'value'
}
```

## Use Cases

<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->

Creating aliases of symbol constants without losing type information.

## Examples

<!-- Show how this would be used and what the behavior would be -->

### `Symbol.iterator` alias

```typescript
const { iterator } = Symbol

const iterable: Iterable<number> = {
  * [iterator] () {
    yield * [0, 1, 2, 3]
  }
}
```

## 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)
Repository: opencv
Issue: Inverse DataType traits are needed
Labels: category: core,RFC

It seems that OpenCV matrices (e.g. `cv::Mat`) does not actually know its underlying native type
- it either needs a template type (e.g. the function `Mat::at<T>`), or
- it needs to do switch-case over the depth value in order to know it,
Further:
- it compares depth values hopping that such comparison corresponds to `sizeof()` of native types
- it makes stupid assumptions (e.g. all depth values above `CV_32S` are fractional types)
- it just cannot automatically tell which type is signed and which is not, and needs hard-coded expressions in various situations (e.g. inside the random generator which need to check the matrix-type limits)
- ...etc

but all of this seems unnecessary with the existence of the trait-types.

Trait types currently work as a lookup from the native-type to the depth and channel values, but the inverse should be possible as well. I believe trait-types should be able to automatically build some kind of compile-time depth-to-native-type inverse lookup, which can be inferred from the current traits implementation without any additional requirements.

What do you think?
Repository: flutter
Issue: Integrate with Smart Text Selection APIs
Labels: a: text input,c: new feature,framework,f: material design,P3,team-design,triaged-design

Android has an open source [libtextclassifier API](https://android.googlesource.com/platform/external/libtextclassifier/+/master) which is used for smart text selection:

![image2](https://user-images.githubusercontent.com/6687929/46423828-59719e80-c6ec-11e8-8c1d-733635afcaad.gif)

The text selection API is C++ and can potentially be used with iOS but there are a couple of problems:
- The library is part of AOSP so I am not sure if it can be included in Flutter as a first class dependency.
- They generate Intents on Android to open up relevant actions (such as Map). So the current recommended way of integration on Android is via the [Java API](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/view/textclassifier/TextClassifier.java).
Repository: flutter
Issue: Feature request: Allow datepicker to select multiple days and return them as List<DateTime>
Labels: c: new feature,framework,f: material design,f: date/time picker,P3,team-design,triaged-design

The Current datepicker only supports selecting one day.
When  showDatePicker(params) is called it returns a DateTime for the selected date, which is great, but it will be even better if there is an option that allows for multiple date selection and returning them as a list of <DateTime>.
This is not an actual issue but a feature that would make flutter shine more.
Repository: create-react-app
Issue: Dynamic import doesn't work with SVG imported as ReactComponents
Labels: issue: bug,issue: needs investigation

<!--
  PLEASE READ THE FIRST SECTION :-)
-->

### Is this a bug report?
Yes

### Did you try recovering your dependencies?
Yes

### Which terms did you search for in User Guide?
SVG, ReactComponent, dynamic import

### Environment
```
  System:
    OS: macOS 10.14
    CPU: x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
  Binaries:
    Node: 10.11.0 - /usr/local/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 69.0.3497.100
    Firefox: 61.0.2
    Safari: 12.0
  npmPackages:
    react: ^16.5.2 => 16.5.2
    react-dom: ^16.5.2 => 16.5.2
    react-scripts: 2.0.3 => 2.0.3
  npmGlobalPackages:
    create-react-app: 2.0.2
```
### Steps to Reproduce

1. Try to import SVG as ReactComponet using import(). Example code below


### Expected Behavior
SVG loads


### Actual Behavior
Got following error in browser
```
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
```

This happens because importing module doesn't contain ReactComponent property. Here's console.log output from demo 
```
Module {default: "/static/media/logo.5d5d9eef.svg", __esModule: true, Symbol(Symbol.toStringTag): "Module"}
```

### Reproducible Demo

```jsx
import React, { Component } from 'react';
import './App.css';

class App extends Component {
  constructor (props) {
    super(props)
    this.logoComponent = 'div'
  }

  componentDidMount () {
    import('./logo.svg').then((m) => {
      console.log(m)
      this.logoComponent = m.ReactComponent
      this.forceUpdate()
    })
  }

  render() {
    const Logo = this.logoComponent

    return (
      <div>
        <Logo />
      </div>
    )
  }
}

export default App;
```

 ### Workaround

1. Create file with following content
```javascript
import { ReactComponent as Logo } from './logo.svg'
export default Logo
```
2. Use dynamic import as usual for this file