sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Misleading error message when forgetting interface body
Labels: Suggestion,Help Wanted,Experience Enhancement

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

"An interface can only extend an identifier/qualified-name with optional type arguments", interface, body

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about the error message.

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.3.0-beta#code/JYOwLgpgTgZghgYwgAgEJwM4QIwB4AqAfMgN4BQylyAthGABYD2AJtgBQBucANgK4QAuZPgCUQjo2DMA3GQC+ZMqEixEKdFgBMBYuSo06TZps49+Q0eMkz5i5dHhJkAEWjAOEZjuQQAHpBBmDDRMHB0AGhCtHWkgA)

### 💻 Code

The following code tries to declare an interface `Derived<T>` deriving from `Base1<T>` and `Base2<T>` without any extra members. I forgot to type the empty interface body `{}`, instead typing a semicolon.

```ts
interface Base1<T> {
    method1(value: T): void;
}

interface Base2<T> {
    method2(value: T): void;
}

// Missing {} at the end of the following line.
interface Derived<T> extends Base1<T>, Base2<T>;
```

### 🙁 Actual behavior

In the last line of code, I get the following error:

> An interface can only extend an identifier/qualified-name with optional type arguments. (2499)

The error doesn't address the actual problem (the missing braces). Instead, it reads as if there was something wrong with deriving from `Base2<T>`. I actually took it to mean that I cannot derive from a generic interface, so I spent time trying to find out more about this (non-existing) limitation.

### 🙂 Expected behavior

Instead of the misleading error message, I'd expect to get an error telling me that the curly braces are missing.

To be fair, this error *does* show, but not always: If there is a line break after the last line, the correct error will show on the first character of the following empty line (see screenshot). But this is nearly invisible next to the big red (wrong) error above.

![image](https://user-images.githubusercontent.com/5963162/117615015-7191e000-b169-11eb-96e1-9d586ffc9f1c.png)
Repository: opencv
Issue: Using CAP_MSMF and CAP_DSHOW at the same time with two USB cameras causes problems
Labels: category: videoio(camera),platform: win32

##### System information (version)
- OpenCV => 4.5.2.52
- Python: Python 3.9.4
- Operating System => Windows 64 Bit (20H2)

##### Detailed description
If I start one camera with CAP_MSMF and the second one with CAP_DSHOW a bit later, then it fails to open the CAP_DSHOW camera.
If i do it the other way around it works without problem.

In another program I experienced the situation, that it even interrupted the reading of the CAP_MSMF camera with the following error, if I started the second camera with CAP_DSHOW later.
`[ WARN:0] global C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-m8us58q4\opencv\modules\videoio\src\cap_msmf.cpp (1021) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638
`

[This](https://forum.opencv.org/t/using-cap-msmf-and-cap-dshow-at-same-time-with-two-cameras-causes-cant-grab-frame-error-2147483638/3239) is the according discussion in the OpenCV forum.

##### Steps to reproduce
During my tests a had two USB webcams connected via a USB 3.0 hub.

**`test1.py`**, which uses `CAP_MSMF`:
```
import cv2
import numpy as np

#video = cv2.VideoCapture(0, cv2.CAP_DSHOW)
video = cv2.VideoCapture(0, cv2.CAP_MSMF)

if video.isOpened(): # try to get the first frame
    rval, frame = video.read()
else:
    rval = False

while 1:
    cv2.imshow("preview1", frame)
    rval, frame = video.read()

    key = cv2.waitKey(1)
    if key == 27: # exit on ESC
        break
```


**`test2.py`**, which uses `CAP_DSHOW`:
```
import cv2
import numpy as np

video = cv2.VideoCapture(1, cv2.CAP_DSHOW)
#video = cv2.VideoCapture(1, cv2.CAP_MSMF)

if video.isOpened(): # try to get the first frame
    rval, frame = video.read()
else:
    rval = False

while 1:
    cv2.imshow("preview2", frame)
    rval, frame = video.read()

    key = cv2.waitKey(1)
    if key == 27: # exit on ESC
        break
```

If I start `test2.py` (`CAP_DSHOW`) first and after it `test1.py` (`CAP_MSMF`), then everything is fine and both videos are shown.
But if I do it the other way around, then `video.isOpened()` in test2.py returns false and it is not possible to read a frame.

The behavior is a bit different to the issue which happened during my test with a thermal cam (it interruped an already opened camera frame reading with the error mentioned above), but it points out that there is a problem using `CAP_DSHOW` and `CAP_MSMF` at the same time.
Repository: neovim
Issue: Terminal restoration broke with 0.4.3
Labels: bug,terminal

<!-- Before reporting: search existing issues and check the FAQ. -->

- `nvim --version`: 
```
NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-gOb7vg/neovim-0.4.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-gOb7vg/neovim-0.4.3/build/config -I/build/neovim-gOb7vg/neovim-0.4.3/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-gOb7vg/neovim-0.4.3/build/src/nvim/auto -I/build/neovim-gOb7vg/neovim-0.4.3/build/include
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
```
I also tried 0.4.4 with the appimage.
- Operating system/version: Ubuntu 20.04
- Terminal name/version: Yakuake/Tilix
- `$TERM`: xterm-256color

### Steps to reproduce using `nvim -u NORC`

```
nvim --clean
:e term://~/dir1/dir2//PID:/bin/bash
```

### Actual behaviour

```
Error detected while processing BufReadCmd Autocommands for "term://*:
E475: Invalid argument: expected valid directory
```

### Expected behaviour

Opens a new terminal, like it used to.
Repository: storybook
Issue: Expose a mocking API
Labels: feature request,core,test utilities

**Is your feature request related to a problem? Please describe**
When building components, one would like to mock some things to visualize components in some edge cases. For example, imagine I have a `useWidth` react hook that is using `IntersectionObserver` under the hood. I would like to test this component under the SSR circumstances (where width === 0) to see how it behaves (without convoluting its props just for that purpose).

In past I've been using `decorators` + `sinon.sandbox`  to somehow set this up https://github.com/insights-io/Insight/blob/master/frontend/shared/storybook/src/decorators/mockDecorator.ts, but this setup for some reason doesn't work in all environments (e.g. CRA, NextJS, custom webpack,...)

**Describe the solution you'd like**
I would like `storybook` to expose some kind of mocking API that would reliably work in all environments. It can be just a decorator.

Example API using `sinon`:
```js
Story.decorators = [mockDecorator(sandbox => {
   sandbox.stub(MyModule, 'x').returns(0)
})]
```


**Describe alternatives you've considered**
As mentioned, I've tried my own implementations for this problem, but they are not reliable. I assume internally you have more control over the `require` mechanism and can implement this more reliably.

**Are you able to assist to bring the feature to reality?**
Maybe
Repository: rust
Issue: Confusing error message when trying to call a method from an extension trait that does not apply
Labels: A-diagnostics,T-compiler

Given the following code:

```rust
trait MyTrait {
    fn foo(&self);
}

trait MyTraitExt {
    fn foo2(&self);
}

impl<T: MyTrait> MyTraitExt for T {
    fn foo2(&self) {
        self.foo();
    }
}

struct MyStruct;

fn main() {
    let a = MyStruct;
    a.foo2();
}
```
[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d76182e8fa4a827d945011cdfc149349)

The current output is:

```
error[E0599]: the method `foo2` exists for struct `MyStruct`, but its trait bounds were not satisfied
  --> src/main.rs:20:7
   |
16 | struct MyStruct;
   | ----------------
   | |
   | method `foo2` not found for this
   | doesn't satisfy `MyStruct: MyTraitExt`
   | doesn't satisfy `MyStruct: MyTrait`
...
20 |     a.foo2();
   |       ^^^^ method cannot be called on `MyStruct` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `MyStruct: MyTrait`
           which is required by `MyStruct: MyTraitExt`
```

However if we consider a similar piece of code:
```rust
trait MyTrait {
    fn foo(&self);
}

struct MyStruct;

fn main() {
    let a = MyStruct;
    a.foo();
}
```
[playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=841d36d7981b95f1358e3e873473904b)

it produces a much better error:
```
error[E0599]: no method named `foo` found for struct `MyStruct` in the current scope
  --> src/main.rs:10:7
   |
6  | struct MyStruct;
   | ---------------- method `foo` not found for this
...
10 |     a.foo();
   |       ^^^ method not found in `MyStruct`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `MyTrait` defines an item `foo`, perhaps you need to implement it
  --> src/main.rs:2:1
   |
2  | trait MyTrait {
   | ^^^^^^^^^^^^^
```
Ideally the error should not suggest that the method exists. I came across this error when someone tried to call [`StreamExt::skip_while`][1] on a [`tokio::io::BufReader`][2]. In this case the compiler suggested that the method exists, but the trait bounds were not satisfied, however there is nothing you could have done in that person's project to make that call succeed. The `BufReader` type never implements `Stream`.

[1]: https://docs.rs/tokio-stream/0.1/tokio_stream/trait.StreamExt.html#method.skip_while
[2]: https://docs.rs/tokio/1/tokio/io/struct.BufReader.html
Repository: vscode
Issue: Reserve some space to the right of the hover to be able to grab the scrollbar
Labels: bug,verification-found,editor-hover,papercut :drop_of_blood:

cc @bpasero

https://user-images.githubusercontent.com/5047891/117639751-8e87dc80-b184-11eb-8b55-fb6179ec4549.mp4
Repository: electron
Issue: [Bug]: window.focus doesn't work
Labels: bug :beetle:,14-x-y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

14.0.0-nightly.20210503

### What operating system are you using?

Windows

### Operating System Version

Windows 10

### What arch are you using?

x64

### Last Known Working Electron version

14.0.0-nightly.20210413

### Steps to reproduce
Open devtools and execute this code:
```
win = window.open(location.href)
win.focus()
```
### Expected Behavior

Call to window.focus focuses the window.

### Actual Behavior

Call to window.focus doesn't focus the window.

### Testcase Gist URL

_No response_

### Additional Information

It regressed between versions 14.0.0-nightly.20210413 and 14.0.0-nightly.20210426. I suspect this change to cause the problem: https://github.com/electron/electron/pull/28552. Possible fix for the problem is to make a call to:
```
web_contents()->Focus();
```
in `WebContents::ActivateContents`, file `shell/browser/api/electron_api_web_contents.cc`.
Repository: flutter
Issue: [google_maps_flutter] Add longPress Callback on Marker
Labels: c: new feature,p: maps,package,c: proposal,team-ecosystem,P3,triaged-ecosystem

## Proposal
Hello,

it would be great if the marker would have a callback-function like the onLongPress function on the google map. But it should return the position of the marker on the screen.

For example:
```
return Marker(
        markerId: MarkerId(this._id),
        position: this._position,
        icon: await _getIcon(),
        onTap: () {
              //show a Container
        },
        onLongPress: (positionOnScreen p) {
              //show a small menu
        },
    );
```
If there is already a solution and i havent found it, please contact me. I've tried to wrap it in a gesturedetector or to loop through the positions of the Marker on longpress on the map an check if the position is one of the markerpositions but thats to inaccurate.

Thanks for your work and time,
Repository: go
Issue: cmd/cgo: absolute Unix paths in CFLAGS are converted to relative Windows path when using mingw64 to compile cgo
Labels: NeedsInvestigation,compiler/runtime

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.16.4 windows/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\windows\AppData\Local\go-build
set GOENV=C:\Users\windows\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\windows\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\msys64\mingw64\lib\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\msys64\mingw64\lib\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\msys64\home\windows\projects\openssl\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\msys64\tmp\go-build390699566=/tmp/go-build -gno-record-gcc-switches
</pre></details>

### What did you do?

Given **test.go** and **go.mod**:

**test.go**
<pre>
package test

// #cgo CFLAGS: -I/usr/local/openssl/include -Wno-deprecated-declarations
import "C"
</pre>

**go.mod**
<pre>
module test

go 1.16
</pre>

**Execute this**
<pre>
$ go build -x
</pre>


### What did you expect to see?

<pre>
WORK=C:\msys64\tmp\go-build908052126
mkdir -p $WORK\b001\
cd C:\msys64\home\windows\projects\test
CGO_LDFLAGS='"-g" "-O2"' "C:\\msys64\\mingw64\\lib\\go\\pkg\\tool\\windows_amd64\\cgo.exe" -objdir "$WORK\\b001\\" -importpath test -- -I "$WORK\\b001\\" -g -O2 "-I/usr/local/openssl/include" -Wno-deprecated-declarations "C:\\msys64\\home\\windows\\projects\\test\\test.go"
...
</pre>

### What did you see instead?

<pre>
WORK=C:\msys64\tmp\go-build908052126
mkdir -p $WORK\b001\
cd C:\msys64\home\windows\projects\test
CGO_LDFLAGS='"-g" "-O2"' "C:\\msys64\\mingw64\\lib\\go\\pkg\\tool\\windows_amd64\\cgo.exe" -objdir "$WORK\\b001\\" -importpath test -- -I "$WORK\\b001\\" -g -O2 "-IC:\\msys64\\home\\windows\\projects\\test\\usr\\local\\openssl\\include" -Wno-deprecated-declarations "C:\\msys64\\home\\windows\\projects\\test\\test.go"
...
</pre>
Repository: godot
Issue: ERROR: can_process: Condition "!is_inside_tree()" is true. Returned: false 
Labels: bug,topic:core,confirmed

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues/4162
-->

**Godot version:**
v3.3


**OS/device including version:**
win10


**Issue description:**
When the node is removed from the scene tree, the mouse event still accesses the node. Trigger error "can"_ process: Condition "! is_ inside_ tree()" is true. Returned: false "


**Steps to reproduce:**
1，Run the main scene and click the falling rigid body
![鼠标点击](https://user-images.githubusercontent.com/80683955/117659078-134b1880-b1ce-11eb-96dd-1ad08c58f223.gif)

2，Mouse static, press the space bar, it will not report an error
![空格](https://user-images.githubusercontent.com/80683955/117659369-72a92880-b1ce-11eb-97d7-f762a489b9d0.gif)

3，Move the mouse, press the space bar, will also report an error
![error2](https://user-images.githubusercontent.com/80683955/117660015-3924ed00-b1cf-11eb-9ff0-cedc8b869f7c.gif)


**Minimal reproduction project:**
[Toolbox.zip](https://github.com/godotengine/godot/files/6452005/Toolbox.zip)
Repository: pytorch
Issue: torch.lerp to support argument type promotion / broadcasting similar to torch.where
Labels: triaged,module: type promotion,module: interpolation

It would be nice to support python scalars as start or end.

Similar work has been done for torch.where

cc @gchanan @mruberry @nairbv
Repository: flutter
Issue: [web] Link widget should support title
Labels: c: new feature,platform-web,p: url_launcher,package,c: proposal,P2,team-web,triaged-web

## Use case

Modern websites are easy to copy links, right-click on a button and you can copy the link. This is very important because users might want to share URLs, save URLs, etc.

## Proposal

Having the ability to right-click on most compatible buttons and get open in a new tab, copy link, etc. The link should be easy to generate as if I use pushNamed, you can guess what the URL is going to be. Also, there should be an option to override the default URL for a button.

Also, if you long press and drag a button, you see this:

![image](https://user-images.githubusercontent.com/56755783/117670408-86459680-b1b0-11eb-813c-8c2c5bceb7aa.png)
Repository: PowerToys
Issue: Color Picker appears under Shortcut Guide when invoked
Labels: Product-Shortcut Guide,Product-Color Picker

### Microsoft PowerToys version

0.37.0

### Running as admin

- [X] Yes

### Area(s) with issue?

ColorPicker, Shortcut Guide

### Steps to reproduce

Well i was using the color picker and then i wanted to see the windows shortcut guide and then the color picker goes behind it. I'm sure its not too hard to implement to make the color picker come ontop of the shortcut guide.

https://user-images.githubusercontent.com/77044546/117674201-c2c2c380-b1ab-11eb-822f-1c1c317db608.mp4



### ✔️ Expected Behavior

The ColorPicker to be infront of the shortcut guide

### ❌ Actual Behavior

the color picker ended up behind it

### Other Software

_No response_
Repository: pytorch
Issue: [structured] Clarify if NoNamesGuard is actually needed in impls or not
Labels: triaged,module: structured kernels

https://github.com/pytorch/pytorch/pull/57797 adds NoNamesGuard to a bunch of new impl functions and I don't know if they're necessary or not, or whether or not we're obligated to add these to all structured kernels or not.
Repository: next.js
Issue: `url()` references in css files do not use `assetPrefix` in transformed urls
Labels: bug

### What version of Next.js are you using?

10.2.0

### What version of Node.js are you using?

14.16.0

### What browser are you using?

Chrome

### What operating system are you using?

macOS

### How are you deploying your application?

npm run dev (with custom express server)

### Describe the Bug

Custom `assetPrefix` does not prefix reference urls that have been automatically transformed in css files. If a css file references a font for example, the transformed url font will not use `assetPrefix` even though a proper value for `assetPrefix` has been set

The url transformation seems to be happening here [here](https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack/config/blocks/css/index.ts#L288)

![Screenshot 2021-05-12 at 10 02 06](https://user-images.githubusercontent.com/19775351/117932763-6fff1e00-b309-11eb-9c34-670c99f451e8.png)

### Expected Behavior

Transformed urls in css will use `assetPrefix` similar to other static assets when `assetPrefix` is defined. 

```
// in custom server server.js
// Set asset prefix
app.setAssetPrefix('/prefix-a');
```

```
// Use local font
@font-face {
  font-family: custom-font;
  src: url("./fonts/Itim-Regular.ttf");
}

body {
  font-family: custom-font;
}
```

Font should be loaded as (`assetPrefix` exists in url)
`http://localhost:3000/prefix-a/_next/static/media/Itim-Regular.f70e0d25637f63995673d4cb6429d3ab.ttf`

But it's actually loaded as (no `assetPrefix` in url)
`http://localhost:3000/_next/static/media/Itim-Regular.f70e0d25637f63995673d4cb6429d3ab.ttf`

### To Reproduce

Repository with full reproduction can be found [here](https://github.com/genetschneider/nextjs-no-assetprefix). Just `npm run build` and `npm run dev` and you'll notice the issue immediately.