sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Permit functions that return a value to also serve as a type guard
Labels: Suggestion,Awaiting More Feedback

## Search Terms

Linear type, affine type, type guard

## Suggestion

It would be very helpful to allow a function to serve as a type guard, but also return an unrelated value.

## Use Cases

This can be used to express type changes as a result of mutating operations, covering some of the use cases of e.g. Rust's affine types. (See also #16148.)

## Examples

Consider this example, compiled with `--strictNullChecks`:

```ts
type NonEmptyArray<T> = {
  pop(): T;
} & Array<T>;

function isNonEmpty<T>(array: Array<T>): array is NonEmptyArray<T>;
function isNonEmpty(array: Array<unknown>): boolean {
  return array.length > 0;
}

let array: string[] = ['element'];
if (isNonEmpty(array)) {  // Guard gives 'array' type NonEmptyArray<string>.
  const elem1: string = array.pop();  // Works. This is correct.
  const elem2: string = array.pop();  // Also works, but elem2 will be undefined at runtime!
}
```

We could make this correct if `pop()` could both return a value *and* behave as a type guard. This isn't great syntax, but nonetheless consider if this was supported:

```ts
type NonEmptyArray<T> = {
  pop(): T && this is Array<T>;
} & Array<T>;

function isNonEmpty<T>(array: Array<T>): array is NonEmptyArray<T>;
function isNonEmpty(array: Array<unknown>): boolean {
  return array.length > 0;
}

let array: string[] = ['element'];
if (isNonEmpty(array)) {  // Guard gives 'array' type NonEmptyArray<string>.
  const elem1: string = array.pop();  // Returns a string and gives 'array' type Array<string>.
  const elem2: string = array.pop();  // Doesn't compile; pop() returns 'string | undefined'!
}
```

## Checklist

My suggestion meets these guidelines:

* [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code

This can use a new, previously invalid syntax to avoid affecting any existing program.

* [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.)

There's no change in the code that's emitted; this feature would exist purely at the level of the type system.

* [X] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).

I believe that it would. It seems to be aligned well, in particular, with "Statically identify constructs that are likely to be errors."
Repository: terminal
Issue: CONSOLE_INFORMATION::IsConsoleLocked and CONSOLE_INFORMATION::GetCSRecursionCount inappropriately groveling into opaque CRITICAL_SECTION object internals
Labels: Product-Conhost,Area-Server,Issue-Bug

> These two functions appear to be peering into the internal opaque CRITICAL_SECTION object.  The CRITICAL_SECTION definition is opaque and shouldn't be used by apps (it can - and has - changed layout between OS versions so long as the size is the same).
> 
> The CONSOLE_INFORMATION object should track an owning thread ID and critical section entry count itself if it needs to get this information and shouldn't try to assume that it knows about the critical section implementation details (particularly for OSS'd code we'd like to avoid encouraging that sort of thing as it inevitably leads to broken apps on future OS updates etc.).
> 
> bool CONSOLE_INFORMATION::IsConsoleLocked() const
> {​
>     // The critical section structure's OwningThread field contains the ThreadId despite having the HANDLE type.​
>     // This requires us to hard cast the ID to compare.​
>     return _csConsoleLock.OwningThread == (HANDLE)GetCurrentThreadId();​
> }​
> ​
> ​
> ULONG CONSOLE_INFORMATION::GetCSRecursionCount()​
> {​
>     return _csConsoleLock.RecursionCount;​
> }​
>
Repository: terminal
Issue: Investigate using ZWNJ at the beginning of COOKED_READ_DATA line 
Labels: Issue-Feature,Product-Conhost,Area-Input,Area-CookedRead

This is a follow on from #514.

We could potentially insert a ZWNJ at the beginning of a cooked read data line to prevent ligature joins from happening between the immutable text and the prompt line for applications that use the cooked read data services of the `conhost.exe`. This would make this work automagically for `cmd.exe` and a bunch of little utilities.

There are some concerns about sending that through ConPTY that I think are justified (as would be required to make this work in any fashion on the Windows Terminal UI). 

Either way, this is going to need someone to fool around with it and see what works and what doesn't.
Repository: flutter
Issue: The --track-widget-creation kernel transformer should return package:paths instead of absolute paths
Labels: framework,f: inspector,P2,team-framework,triaged-framework

Using absolute paths leads to issues as it is harder to detect which paths are package:flutter. This will also help resolve inconsistencies between paths on flutter_web and flutter where different schemes are used due to temporary directories used as part of the build process.
Repository: pytorch
Issue: Lint rule to prevent direct use of #pragma omp
Labels: module: lint,triaged

@ilia-cher, I noticed, quite by accident, that you had expunged all occurrences of `#pragma omp` in favor of `at::parallel_for`. That's cool, should we add a lint rule to prevent people from reintroducing direct use of `#pragma omp`? There's still one occurrence of it in aten/src/THNN/generic/VolumetricConvolutionMM.c and I doubt most reviewers will know to reject reviews if they contain fresh occurrences of `#pragma omp`
Repository: PowerToys
Issue: Add Aero-like or Fluent-like titlebar blur and transparency.
Labels: Help Wanted,Idea-New PowerToy,Product-Tweak UI Design

It would be cool and would make some apps (like **Photos** or **Calculator**) look more consistent if Win32 programs (like **File Explorer**) have Fluent titlebars. It would also make some programs, like the new **Chromium Edge**, look neat with blur and transparency on titlebar!
Repository: pytorch
Issue: [docs] Automatically detect docs missing in rst
Labels: module: docs,module: tests,triaged,enhancement

I propose something like this to find automatically members missing from rst (could be put on some doc page as well). This could also be improved to make a list of public members missing docs altogether.
```python
rst_dir = 'docs/source'

rst = '\n'.join(open(os.path.join(rst_dir, rst_file)).read() for rst_file in os.listdir(rst_dir))

members = lambda obj : [(member, getattr(getattr(obj, member), '__doc__') is not None) for member in dir(obj) if not member.startswith('_') and member not in rst]

doctodo = members(torch) + members(torch.nn) + members(torch.nn.functional)
```
Repository: terminal
Issue: Add Optional Cursor Properties to Color Schemes
Labels: Issue-Feature,Help Wanted,Area-Settings,Product-Terminal

There are several fields assigned against profiles that feel like they would be better placed in schemes (or at least duplicated to schemes):

* `cursorColor`
* `cursorShape` 
* `fontFace`
* `fontSize`

There are two options for these properties that could be utilised:

1. Remove them from the profile and add them to schemes, updating the current schemes with default values.
2. Leave them in the profile and have them act as an override when present, similar to what `background` is doing currently.

Additionally, it may be worth actually removing the default `background` value, to allow the theme background to actually work by default.
Repository: rust
Issue: Private doc test flag
Labels: T-rustdoc,C-feature-request,A-doctests

Doc tests seem to work in a similar way to integration tests, in that the tests are performed from the public facing API. This is great for public facing libraries, however for internal development it would be nice to have doc tests that run in a just-as-easy fashion.

Is this something on the cards that's on the cards or has a work around?
Repository: godot
Issue: font.get_string_size() should support '\n' multiline.
Labels: enhancement,topic:core

I think font.get_string_size() should support '\n' symbol as multiline.
for now everything calculate as one line, and '\n' are ignored!

var size = get_string_size("hello\nworlds");
size.y = could have get_height() * num_lines;
size.x = could have max(line[for_i] , size.x);

**Godot version:**
3.1.1
Repository: youtube-dl
Issue: support for https://unacademy.com/
Labels: site-support-request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2019.05.11. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a new site support request
- [x] I've verified that I'm running youtube-dl version **2019.05.11**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that none of provided URLs violate any copyrights
- [ ] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

- Single video: https://unacademy.com/lesson/vector-space-lesson-1-in-hindi/RD9SAOJX/?source=Course
- Single video: https://unacademy.com/lesson/vector-space-lesson-2-in-hindi/7C823QYM
- Playlist: https://unacademy.com/course/linear-algebra-for-csir-net-math/D74R1NTF


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

Sir/Madam
Plz provide the youtube-dl support for the site https://unacademy.com/. I am unable to download playlist from this. Also, site provides download option to its android app. Support for this site is not helping me only but thousands of students in their learning.
Account details:
ramjmi@gmail.com
ram12345
Repository: go
Issue: reflect: Value.Method does not do the same nil checks as the language
Labels: NeedsInvestigation,compiler/runtime

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
go version go1.12 linux/amd64
</pre>

### What did you do?

```
package main

import (
	"fmt"
	"reflect"
)

type S struct {
	x int
}
func (S) M(int) {}


type T struct {
	*S
}

func main() {
	var v = T{}
	
	t := reflect.TypeOf(v)
	fmt.Println(t, "has", t.NumMethod(), "methods:")
	for i := 0; i < t.NumMethod(); i++ {
		fmt.Print("  method#", i, ": ", t.Method(i).Type, "\n")
	}
	fmt.Println(reflect.ValueOf(v).Method(0)) // ok
	_ = v.M // panic
}
```

### What did you expect to see?

Run okay.

### What did you see instead?

panic.

**Update: [similarly for interface dynamic values](https://github.com/golang/go/issues/32021#issuecomment-612353206)**
Repository: go
Issue: x/build: increase timeouts or reduce parallelism on darwin-arm-mg912baios builder?
Labels: Testing,Builders,NeedsInvestigation

There is a strange effect visible in [this log](https://build.golang.org/log/a5b12928389cb0bdf4e3f3923dd893bddc52e942) on the `darwin-arm-mg912baios` builder.

The tests are running along fine for a while, and when they get to the (presumably CPU-intensive) `hash/*` tests they suddenly dropm from ~150s per test to ~19m per test.

The first couple of `image` tests are similarly slow, but then the builder seems to recover:

```
ok  	go/parser	89.266s
ok  	go/printer	93.493s
ok  	go/scanner	90.741s
ok  	go/token	91.229s
ok  	go/types	93.029s
ok  	hash	95.535s
lldb: running program
PASS
*** Test killed: ran too long (19m0s).
FAIL	hash/adler32	1145.074s
ok  	hash/crc32	1140.671s
ok  	hash/crc64	1139.541s
ok  	hash/fnv	1137.713s
ok  	html	1136.359s
ok  	html/template	1135.509s
ok  	image	1133.465s
ok  	image/color	1135.193s
ok  	image/draw	91.719s
ok  	image/gif	95.854s
ok  	image/jpeg	102.705s
ok  	image/png	102.427s
```

I wonder if that implies some sort of resource contention (perhaps a thermal limit?) between the tests — should we reduce the parallelism of that builder to decrease the likelihood of spurious timeouts?

CC @eliasnaur @steeve @bradfitz @dmitshur
Repository: go
Issue: x/build: linux-amd64-race TryBot straggling
Labels: Performance,Testing,Builders,NeedsInvestigation

In the TryBot run for https://golang.org/cl/176580 at Patchset 4, most of the TryBots ran relatively quickly (less than 10m), but the `linux-amd64-race` builder took much longer (over 20m).

I'm not sure exactly why it was so slow, but it leads me to believe that there may be something wrong with the sharding for that builder.

(CC @bradfitz @dmitshur @andybons)
Repository: terminal
Issue: Get Performance Tests Working
Labels: Product-Conhost,Area-Performance,Issue-Bug,Area-Build

I've added a performance mode to some of the `conhost.feature.tests.dll` tests and managed to ensure that they do work with the WinPerf infrastructure.

Now I need to finish up and get this running in an automated fashion. I'm pretty sure that WinPerf and the Windows Performance backend services are going to remain private, but that won't necessarily stop us from having an internal build that can orchestrate these and submit bugs that we can then pull back out to GitHub.
Repository: go
Issue: spec: document nil checks for value methods
Labels: Documentation,NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
go version go1.12 linux/amd64
</pre>

### What did you do?

```
package main

import (
	"fmt"
)


type S struct {}

func (S) M(n int) {
	fmt.Println(n)
}

type T struct {
	*S
}

type I interface {
	M(n int)
}


func foo() {
	var v = &T{}
	var i I = v
	f := i.M // ok
	v.S = &S{}
	f(111) // 111
}

func bar() {
	var v = &T{}
	f := v.M // panic
	v.S = &S{}
	f(111)
}

func main() {
	foo()
	bar()
}
```

### What did you expect to see?

Same behavior

### What did you see instead?

Different behaviors.
Repository: material-ui
Issue: Feature Request: Warnings for missing ARIA properties
Labels: accessibility,discussion

When rendering certain components such as Menus, Images, etc... it would be awesome if those components that *should* have aria attributes, if they aren't specified would issue `console.warn` statements for non-production builds at render.  This should also include input elements that don't have an `id` property, as they don't tether the label to the input component in a way that can be detected in terms of accessibility.

I think that doing this would encourage developers to tackle the low hanging fruit in terms of accessibility.  It doesn't have to affect functionality, but the debug warning statements would at least be a significant guidance ahead of tools like Lighthouse, Wave and axe.

Should probably spell out each component that offers menu, menu-like functionality, modals, popovers, images, inputs, etc and note when the feature is added.  I'm also not sure which projects externally would need to be coordinated, iirc the svg icons are from an external package.  Svg icons themselves could implement a default alternate text attribute with a console.info statement in debug mentioning to use an explicit {''} if no alt text is desired.

Just created a request for effectively the [same feature](https://github.com/facebook/react/issues/15649) for baseline rendering.  This should also be implemented for wrapper components with a more explicit context here as well.
Repository: pytorch
Issue: Statically make `__setstate__` set all attributes/parameters 
Labels: high priority,module: serialization,triaged

#20242 added support for `__getstate__` and `__setstate__` on a module which is an alternative to automatically saving all parameters/attributes. This means the user must be initializing all parameters/attributes themselves. Like in TorchScript classes' `__init__()`, we should be statically verifying that this is actually happening.

cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @anjali411 @mruberry
Repository: electron
Issue: Allow multiple webRequest handlers
Labels: enhancement :sparkles:

<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [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 for a feature request that matches the one I want to file, without success.

### Problem Description
<!-- Is your feature request related to a problem? Please add a clear and concise description of what the problem is. -->
There's no way to register multiple `webRequest` events such as `onBeforeRequest`

### Proposed Solution
<!-- Describe the solution you'd like in a clear and concise manner -->
It would be great if Electron could provide normal `EventEmitter` object. For example:
```javascript
session.webRequest.on('before-request', ...)
```
Repository: PowerToys
Issue: Trim " in explorer address bar
Labels: Idea-New PowerToy

If I paste a path like “C:\Windows” including the “ to the explorer address bar and press enter it opens a browser window instead of navigating to C:\Windows. It would be nice to trim the “ on navigating.
This would also be a benefit to any save or open file dialog.
Another nice feature would be to ignore \\\ within a path to allow pasting paths where \ was escaped.
Repository: flutter
Issue: Add dependency management support for Windows plugins
Labels: tool,platform-windows,a: desktop,P2,team-windows,triaged-windows

We'll need flutter_tool support for adding the native portions of plugins to the build, including fetching dependencies, plugin registrant generation, etc.

This will likely use NuGet for package management, but that needs evaluation.
Repository: flutter
Issue: Decide on a dependency management plan for Linux plugins
Labels: tool,platform-linux,a: desktop,P2,team-linux,triaged-linux

We'll need flutter_tool support for adding the native portions of plugins to the build, including fetching dependencies, plugin registrant generation, etc.

How dependency management/fetching will be done for Linux is an open question.
Repository: terminal
Issue: Resize reflow tests
Labels: Product-Conhost,Area-Interaction,Issue-Task

I have some note to myself in the internal tracker that resize-with-reflow should probably have a test suite on it. Sure, it's a conhost feature, but it will likely affect the presentation of things through the ConPTY.

We'll probably want to adjust some of the behaviors around resize-with-reflow as we tighten up integration with the PTY and with the Terminal app, and before we make big changes... we should probably have enough tests to convince ourselves that the behavior we currently have is maintained to some degree (or at least changed intentionally, not accidentally).

This was MSFT: 19600272
Repository: terminal
Issue: Create comprehensive word-by-word selection tests
Labels: Product-Conhost,Area-Interaction,Issue-Task

This is ported from MSFT: 19672875.

I don't remember why this exists. I filed this on myself and this is the only information I had.

Maybe I left a to-do item behind somewhere in the code referencing this ID?

It has to have to do with conhost, not with Terminal.
Repository: vscode
Issue: Be able disable task detection from tasks.json or override tasks execution
Labels: feature-request,tasks

Currently VSCode uses `tasks.json` to detect the tasks. If there is a `FileSystemProvider` registered, it will use it to read `tasks.json`. The problem with that is the tasks may not make sense if they come from something else other than `file:/.../.vscode/tasks.json`. E.g. if the file system provider is of a remote kind (like fetching files from sftp or Live Share), tasks from `tasks.json` most likely won't work locally.

To deal with this scenario, VSCode may provide different options:
1. An ability to override task execution for any tasks from `tasks.json`. This work may be merged into #33523. VSCode should pass along the URI of the original `tasks.json` to the extension code that overrides the task execution.
1.  An ability to disable tasks detection from `tasks.json` based on the file scheme. This will be a new API. Alternatively, you can make VSCode respect `tasks.json` only from `file:` scheme and let the extensions opt in other schemes if they so chose.
Repository: terminal
Issue: ReadPendingInput plays unsafe byte/char games with pending data
Labels: Issue-Feature,Product-Conhost,Area-Input,Area-Server

Ported from MSFT: 18047766.

I fixed an immediate crash bug in MSFT: 17987369 that affected this area, but realized at the time that it's really bad that the `ReadPendingInput` function in the console host is playing games with a void pointer and mix-and-match of byte versus character counting.

This represents investigating what we can do to stop mix/matching the char and byte counts in `ReadPendingInput`.

@adiviness might be working on something like this with his changes to input to support emoji...
Repository: go
Issue: x/mobile/cmd/gomobile: Mygomobileios.framework/Mygomobileios(go.o)' does not contain bitcode.
Labels: NeedsInvestigation,mobile

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.12.5 darwin/amd64
gomobile version +32b2708 Thu May 9 16:48:39 2019 +0000 (android,ios); androidSDK=
</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
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
</pre></details>

### What did you do?
gomobile bind -target=ios -tags="ios" -v -ldflags=-w  mygomobileios
<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->



### What did you expect to see?
Success when imported in Xcode and compiled


### What did you see instead?

<pre>

ld: '/mygo/src/mygomobileios/gomobileios_test/Mygomobileios.framework/Mygomobileios(go.o)' 
does not contain bitcode. 
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), 
obtain an updated library from the vendor, or disable bitcode for this target. 
for architecture arm64
</pre>