sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Type declaration of CanvasImageSource in lib.webworker.d.ts is incomplete.
Labels: Bug,Help Wanted,Domain: lib.d.ts

<!-- 🚨 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.
-->

Type declaration of CanvasImageSource in lib.webworker.d.ts is now only `ImageBitMap`.
But that should be `HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap`
https://developer.mozilla.org/en-US/docs/Web/API/CanvasImageSource

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.4.0-dev.201190216

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
CanvasImageSource

**Code**

```ts
let ctx = document.createElement("canvas").getContext("2d")
let img = new Image()
ctx.drawImage(img, 0, 0)
```
tsconfig.json
```json
{
  "compilerOptions": {
    "target": "es2018",
    "module": "commonjs",
    "lib": [
      "webworker",
      "es2018",
      "dom",
    ]
  }
}
```
whole project in https://github.com/Muratam/yabai-sample.ts 

**Expected behavior:**
No error occurs when run `webpack` nor `webpack --watch`

**Actual behavior:**
Following error occurs when incremental build in `webpack --watch`
"TS2345: Argument of type 'HTMLImageElement' is not assignable to parameter of type 'ImageBitmap'.
  Property 'close' is missing in type 'HTMLImageElement' but required in type 'ImageBitmap'"

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
#25468
In that issue, only TypeScript/src/lib/dom.generated.d.ts is referred, but lib.webworker.d.ts is also needed to be referred. Please fix type declaration of CanvasImageSource in lib.webworker.d.ts
Repository: TypeScript
Issue: Missing comments after applying refactor/codefix
Labels: Bug,Help Wanted,Effort: Moderate

<!-- 🚨 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.4.0-dev.201xxxxx

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** missing comment

Several refactors and codefixes cause comments in some positions to disappear after being applied.

- Refactor: Remove braces from arrow function

**Code**

```ts
const a = (a: number) => {/* missing */ return a; /* missing */};
const b = (a: number) => { /* missing */
    return a; /* missing */
}
```
- Refactor: Move to a new file

**Code**

```ts
class A { // missing
    a(s: string) { // missing
        return s;
    }
}
```
- Refactor: extract to function in global scope/extract to function in namespace 'Extract'

**Code**

```ts
namespace Extract {
    class B { // missing
        a(s: string) { // missing
            return s;
        }
    }
}
```
- Codefix: Convert 'SomeType' to mapped object type

**Code**

```ts
type K = "foo" | "bar";
interface SomeType { /*missing*/
    a: string;
    /*missing*/ [prop: K] /*missing*/: any;
}
```
- Codefix: Change '/*missing*/ ?number' to 'number | null' (fix JSDoc Types)

**Code**

```ts
function fn(a: /*missing*/ ?number) {
    return a;
}
```
- Codefix: Convert function to an ES2015 class

**Code**

```js
function fun(b) { // missing
    this.b = b;
}
```
- Codefix: Convert to ES6 module
**Code**

```js
exports.f /*missing*/ = /*missing*/ function() { };
```
- Codefix: Initialize property 'foo' in the constructor
**Code**

```js
// @ts-check
class C {
    constructor() {/*missing*/
        //missing
    }
    prop = ()=>{ this.foo === 10 };
}
```


**Expected behavior:**
Comments should be present after applying refactor/codefix.
**Actual behavior:**
Comments are missing after refactor/codefix.
Repository: TypeScript
Issue: Boolean intellisense
Labels: Suggestion,Awaiting More Feedback

<!-- Please search existing issues to avoid creating duplicates. -->
Intellisense is great for things like `typeof`, so why not make it great for boolean types too!

<!-- Describe the feature you'd like. -->
I think adding intellisense for booleans saves a bit of typing, and it still hasn't been implemented.

Look at this:

```ts
const a = (): boolean => true;
a() === // [true, false] intellisense prompt
const b = a();

if (b === /* [true, false] intellisense prompt*/) 
```

I think this would be a great addition to Intellisense. Any feedback is appreciated.
Repository: TypeScript
Issue: Suggestion: support Node `require` in ES Modules
Labels: Suggestion,In Discussion

<!-- 🚨 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

node require commonjs webpack conditional dynamic import

## Suggestion

Node style `require`'s are often used *inside ES Modules* for conditional imports. For example:

``` ts
const getSentry = () => {
  if (__CLIENT__) {
    return require('./client-sentry').default;
  } else {
    return require('./server-sentry').default;
  }
};

export default getSentry();
```

In this example, `require` returns `any` as per the typings provide by `@types/node`.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5f59f3dc7a0965fb1767cf13c670c633bbbbf0a8/types/node/globals.d.ts#L190-L193

In order to acquire types, we have to use `import` types:

``` ts
type ClientSentry = typeof import('./client-sentry');
type ServerSentry = typeof import('./server-sentry');

const getSentry = () => {
  if (__CLIENT__) {
    return (require('./client-sentry') as ClientSentry).default;
  } else {
    return (require('./server-sentry') as ServerSentry).default;
  }
};

export default getSentry();
```

I would like to suggest that TypeScript supports `require` calls inside of ES Modules (in Node envs). This way the workaround would not be necessary. Alternatively, perhaps TypeScript could make it possible for `@types/node` to improve the return type of `require`, e.g.

``` ts
interface NodeRequireFunction {
    <Id extends string>(id: Id): typeof import(Id);
}
```

Note that `require` is desirable over dynamic imports because it is synchronous.

## 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: go
Issue: x/build: make GOROOT read-only before running tests
Labels: Builders,NeedsFix

When #28387 is fixed, we should make sure that it doesn't regress.

Can we configure the builders to make GOROOT read-only before they invoke `run.bash`, and perhaps restore write permissions after the tests have finished?

(CC @bradfitz @dmitshur)
Repository: flutter
Issue: Support for AssetBundle to get each platforms bundle path
Labels: c: new feature,framework,engine,a: assets,customer: crowd,P2,team-engine,triaged-engine

This is related to issue: https://github.com/flutter/flutter/issues/11892

But in particular it would be reasonable if from Dart (and perhaps via the assetbundle API itself) we could have the ability to get the path for each platforms bundle (NSBundle or AssetManager).

This would be useful in order to easily pack other types of files (e.g. databases, pdfs) into the app and read them easily. Right now, the only solution I'm aware of is copying each file manually from assets into each platform's documents directory and then using that as our "file repository".
Repository: react-native
Issue: Support styles (borderX) for <Text /> on IOS
Labels: Platform: iOS,Issue: Author Provided Repro,Component: Text,Impact: Platform Disparity,Priority: Low,Bug

## 🐛 Bug Report
IOS don't support next styles for `<Text/>` component!
```js
borderTopWidth\borderTopColor
borderBottomWidth\borderBottomColor
borderLeftWidth\borderLeftColor
borderRightWidth\borderRightColor
``` 

## To Reproduce
```js
        <Text style={{borderWidth: 1}}>borderWidth</Text>
        <Text style={{borderLeftWidth: 1}}>borderLeftWidth</Text>
        <Text style={{borderRightWidth: 1}}>borderRightWidth</Text>
        <Text style={{borderTopWidth: 1}}>borderTopWidth</Text>
        <Text style={{borderBottomWidth: 1}}>borderBottomWidth</Text>
        <Text style={{borderWidth: 1, borderBottomWidth: 0,}}>borderWidth\borderBottomWidth</Text>      
```

## Expected Behavior
Full style props (`borderLeftX,borderTopX, ...`) support like Android!

## Code Example
Example: https://snack.expo.io/@retyui/test-borders

### IOS example:
![IOS](https://user-images.githubusercontent.com/4661784/53046185-8a3a5080-34a0-11e9-9f90-dd1b0f54926c.png)

### Android
![Android](https://user-images.githubusercontent.com/4661784/53046401-003eb780-34a1-11e9-90bc-c2652204f2a6.png)


## Environment 
```sh
  React Native Environment Info:
    System:
      OS: Linux 4.15 Linux Mint 18.3 (Sylvia)
      CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
      Memory: 9.63 GB / 15.55 GB
      Shell: 2.7.1 - /usr/bin/fish
    Binaries:
      Node: 10.15.1 - /usr/bin/node
      Yarn: 1.13.0 - ~/.yarn/bin/yarn
      npm: 6.7.0 - /usr/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
        System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
    npmPackages:
      react: 16.8.1 => 16.8.1 
      react-native: 0.59.0-rc.2 => 0.59.0-rc.2 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-create-library: 3.1.2
```
Repository: go
Issue: proposal: spec: let := support any l-value that = supports
Labels: LanguageChange,Proposal,LanguageChangeReview

(Pulling this specifically out of #377, the general `:=` bug)

This proposal is about permitting a struct field (and other such l-values) on the left side of `:=`, as long as there's a new variable being created (the usual `:=` rule).

That is, permit the `t.i` here:

```go
func foo() {
    var t struct { i int }
    t.i, x := 1, 2
    ...
}
```

This should be backwards compatible with Go 1.

**Edit:** clarification: any l-value that `=` supports, not just struct fields.

/cc @griesemer @ianlancetaylor
Repository: flutter
Issue: Document which listener will win with HitTestBehavior.translucent
Labels: framework,d: api docs,f: gestures,P2,team-framework,triaged-framework

In the HitTestBehavior.translucent doc, document who will typically win if both the translucent parent and its descendent listen to the same event. 

https://github.com/flutter/flutter/issues/18450 related
Repository: rust
Issue: Clarify that Rust std library `unsafe` tricks can't always be used by others
Labels: C-enhancement,A-docs,T-libs

The union RFC [says](https://github.com/rust-lang/rfcs/blob/master/text/1444-union.md#unions-and-undefined-behavior):
> In addition, since a union declared without `#[repr(C)]` uses an unspecified binary layout, code reading fields of such a union or pattern-matching such a union must not read from a field other than the one written to.

However, there are several cases which explicitly read from a field different from the one written to, for example, [`str.as_bytes()`](https://github.com/rust-lang/rust/blob/74e35d270067afff72034312065c48e6d8cfba67/src/libcore/str/mod.rs#L2131-L2137) which was introduced in #50863 to make many of the stuff `const`.
Repository: pytorch
Issue: Use standard docker image for XLA build
Labels: oncall: releng,triaged,module: xla,module: docker

Currently the "xla" build uses a different docker image version number than the other builds.  Try to unify them.

cc @bdhirsh @gmagogsfm
Repository: go
Issue: all: updating existing errors to work with the Go 1.13 error values
Labels: NeedsInvestigation

This issue is for discussing how to update errors in the standard library and golang.org/x packages to work with the Go 2 error values changes proposed in #29934.

That issue is for discussing the proposal itself. This is for discussing how best to update existing error types to make the most use of the new additions to the errors package, assuming that it is accepted.

All calls to `errors.New` will be updated automatically.

All calls to `fmt.Errorf` that do not wrap errors will be updated automatically. Those that wrap errors will not be.

No custom types, outside of the errors package itself, will be updated automatically.

How will the errors that would require manual updating be updated?

For `fmt.Errorf` the only question is whether to turn a `%s`/`%v` to a `%w`.

For custom types, the questions are
- should they have an `Unwrap` method?
- should they collect stack frames?
- should they have a `FormatError` method?
- Do any require an `Is` method?
- An `As` Method?

If one of the above obviates an older approach (like an `Err error` field on a struct) should the older approach be marked deprecated?

Even with a general policy, there will likely be exceptions.

`net.Error`'s extra methods vs `os.IsTimeout` and co. is a particular wrinkle.

The `os.IsX` predicates test the underlying error of a finite set of error types for certain (platform specific) error values. This does not work with arbitrarily wrapped errors. @neild's https://golang.org/cl/163058 contains a proof-of-concept for changing it so that one can write the more general `errors.Is(err, os.ErrTimeout)` instead of `os.IsTimeout(err)`.

The predicate methods defined in `net.Error` offer a similar approach. In the case of `IsTimeout`, overlapping. To test a general error for this method you can write
```
var timeout interface { IsTimeout() bool }
if errors.As(err, &timeout) && timeout.IsTimeout() { //etc.
```
This is slightly more verbose than the `Is` construct. 

Adding an `Is` method to `net.Error`s that respond to `ErrTimeout` and an `ErrTemporary` could make it more like `os`. Adding predicate methods to the `os` errors could make them more like `net`. Ideally they would be the same because if they're wrapped in further errors the code inspecting them may not know which package the original comes from and would have to handle both.

The approaches are not equivalent when there are multiple errors in the chain that can have the same property. Say error `A` wraps error `B` and either may be temporary but only `B` is. The `As` construct sets `timeout` to `A` whose method returns false (unless it inspects the chain on its own) but the `Is` construct returns true. If the intent is to override the temporary-ness of `B` an `Is` method on `A` that returns false for `ErrTemporary` is easy enough. It seems both more flexible and concise.
Repository: flutter
Issue: Please add directions to maps plugin
Labels: c: new feature,p: maps,package,team-ecosystem,P3,triaged-ecosystem

<!-- Thank you for using Flutter!

     Please check out our documentation first:
      * https://flutter.io/
      * https://docs.flutter.io/

     If you can't find the answer there, please consider asking a question on
     the Stack Overflow Web site:
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     Please don't file a GitHub issue for support requests. GitHub issues are
     for tracking defects in the product. If you file a bug asking for help, we
     will consider this a request for a documentation update.

-->
Repository: flutter
Issue: Could SliverList have header 
Labels: c: new feature,framework,f: scrolling,would be a good package,P3,team-framework,triaged-framework

<!-- Thank you for using Flutter!

     Please check out our documentation first:
      * https://flutter.io/
      * https://docs.flutter.io/

     If you can't find the answer there, please consider asking a question on
     the Stack Overflow Web site:
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     Please don't file a GitHub issue for support requests. GitHub issues are
     for tracking defects in the product. If you file a bug asking for help, we
     will consider this a request for a documentation update.

-->

I'm trying to add header text on each `SliverList` or `SliverGrid`. The way I tried is adding `SliverList` with `Text` widget child.
```dart
SliverList(
          delegate: SliverChildBuilderDelegate(
              (BuildContext context, int index) {
                return Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Text(
                    "Header 1"
                  ),
                );
              },
            childCount: 1
          ),
        ),
```
Another way could be having outer `SliverList` which has header and contents list.
Is there any sliver wrapper widget to handle Text? Or wonder if `SliverList` and `SliverGrid` could have header property.
Repository: flutter
Issue: How to use local aar inside flutter plugin?
Labels: platform-android,d: api docs,t: gradle,P2,a: plugins,team-android,triaged-android

I'm trying to use a local .aar file inside a flutter plugin, but so far I couldn't figure out how to achieve this.

Steps I did:

1) Created a flutter plugin (named `flutter_plugin_with_aar`) project with Android Studio using the flutter plugin template
2) Modified the `<Plugin folder>/flutter_plugin_with_aar/android/build.gradle`

3) When I try to run the example app included into the plugin I get the following error:
```
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Could not resolve all files for configuration ':flutter_plugin_with_aar:debugCompileClasspath'.
> Could not find :java_lib_name:.
  Searched in the following locations: file:<Pluginfolder>/flutter_plugin_with_aar/android/libs/java_lib_name.aar
  Required by:
      project :flutter_plugin_with_aar
```

See the modified `<Plugin folder>/flutter_plugin_with_aar/android/build.gradle` below:

```gradle
group 'com.company.flutterpluginwithaar'
version '1.0-SNAPSHOT'

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

rootProject.allprojects {
    repositories {
        google()
        jcenter()
        // added `libs` as dependency location
        flatDir {
            dirs 'libs'
        }
    }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 27

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    defaultConfig {
        minSdkVersion 16
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
    }
}


dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    // this .aar below I'm trying to use
    implementation (name:"java_lib_name",ext:"aar")
}

```

Any thoughts what is the easiest way to add a local .aar to the flutter plugin?
Repository: opencv
Issue: Misleading Net::getPerfProfile for OpenCL target
Labels: category: documentation,category: dnn

##### System information (version)
- OpenCV => 4.0.1
- Operating System / Platform => Intel Core i5-7400, compute-runtime 19.05.12254
- Compiler => gcc 8.2.1

##### Detailed description
When running dnn on OpenCL target, `Net::getPerfProfile()` returns time it took to enqueue kernels and not actually compute them.

##### Steps to reproduce
E.g. use [openpose.py](https://github.com/opencv/opencv/blob/master/samples/dnn/openpose.py) on any model and add line `net.setPreferableTarget(cv.dnn.DNN_TARGET_OPENCL)` after net creation.
It will draw ~10ms on screen while actual call to `net.forward()` take ~1.4s.
Repository: rust
Issue: Fuchsia's target_family should be None, not "unix"
Labels: T-compiler,O-fuchsia

[Currently](https://github.com/rust-lang/rust/blob/74e35d270067afff72034312065c48e6d8cfba67/src/librustc_target/spec/fuchsia_base.rs#L18), the Fuchsia target is part of the unix target_family. I'd like to suggest that this should not be the case, and that `#cfg[unix]` should be false for Fuchsia.

First, I want to capture what I think the _opposite_ case is. Fuchsia does support some amount of posix functionality. That subset is currently informal and pragmatic. It has made starting to port exist software a certain amount easier.

"unix" connotes a lot of things. I've singled out some big ones that do not apply to Fuchsia. I think that in aggregate, these outweigh the benefits mentioned above.

Process model: Fuchsia does not have fork and exec, and does not have a process hierarchy. There's no `wait(2)` or `waitpid(2)` on Fuchsia.

Signals: Fuchsia does not have unix signals.

Filesystems and users: Fuchsia does not have unix users or groups, and does not implement unix filesystem permissions. Fuchsia does not have a global filesystem.

FDs: Files and file descriptors are central, primitive concepts for unix: "everything is a file". In Fuchsia, they are an abstraction built out of other primitives, and working with those primitives directly is often preferred.

C and ABI: Unix system ABIs are typically deeply intertwined with its C standard library, and C is a de facto standard for specifying ABIs (witness `repr(C)`). On Fuchsia, almost all ABIs are specified in a language-agnostic IDL. The biggest exception, the system ABI in, we have been careful to describe in terms of ELF dynamic linkage, rather than C per se.

IO: Portable unix IO boils down to synchronous read(2) and write(2). Abstractions for event-driven programming exist, but are not portable. Fuchsia has limited emulation for some of them, preferring instead to use native constructs more directly.

In aggregate, I think defining `#cfg[unix]` to be true for Fuchsia is tempting, yet a trap. An existing small program which just wants to synchronously manipulate stdin and stdout seems to benefit, for example, until they want to handle ^C with their same unix code.

I'd love for rust programs, existing or not, to be as good as possible as easily as possible when built for Fuchsia. I think not setting `#cfg(unix)` will help with that.

For some background: I work on Fuchsia. Among other things, I am one of the maintainers for our libc.

cc @cramertj