sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: proposal: spec: compile-time boolean assertions
Labels: LanguageChange,Proposal,LanguageChangeReview

I propose adding compile-time boolean assertions to Go.

[I don't feel strongly about this proposal, but it seems pretty minimal; easy to implement; and to make some real world code somewhat easier to read/write. I've also not found any past discussion of this idea, so it seemed worth at least writing down even if rejected.]

# Proposal

Concretely, I propose making these changes:

1. Introduce a new "assert" package like:

       package assert

       type True bool

2. Add a language rule that it's an error to have a constant of type assert.True but value false.

3. (Optional) Add a language rule that it's an error to use assert.True except as the type of a constant.

# Uses

There are somewhat common idioms of writing:

    const _ = -uint(x - y) // assert x == y
    const _ = uint(x - y)  // assert x >= y

But I at least find these awkward to reason about, even being very familiar with the details of how they work.

With this proposal, they could instead be written more clearly as:

    import "assert"

    const _ assert.True = x == y
    const _ = assert.True(x >= y)

(Showing off two different ways to write const declarations using assert.True.)

Further, generalizing to boolean expressions allows us to easily use boolean operators to combine multiple tests. It also potentially allows static assertions involving non-integer constants (i.e., floats, complex, bools, and strings).

For example, [package gc's sizeof_test.go](https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/sizeof_test.go) could be rewritten as compile time asserts like:

    const (
        ptrSize = unsafe.Sizeof((*int)(nil))
        funcSize = unsafe.Sizeof(Func{})

        _ = assert.True((ptrSize == 4 && funcSize == 116) || (ptrSize == 8 && funcSize == 208))
    )

# Backwards compatibility

assert.True doesn't exist today, so there's no code using it that we have to worry about.

Old tools unaware of the special semantics for assert.True (e.g., old compilers or tools using go/types) will continue working for old code. They'll also continue working correctly for new code *that correctly use assert.True*. The tools will, however, fail to detect failing assertions.

# Related proposals

https://github.com/golang/go/issues/9367 proposed allowing bool->int conversions, which be an alternative way of extending the current integer static assertions idiom to arbitrary boolean static assertions. However, it would still be somewhat awkward to read/write.

https://github.com/golang/go/issues/30582 proposes an assertion to indicate unreachable code paths. Technically orthogonal to this one, but it might be worth ensuring they expose a consistent API to users.

C++11 added static_assert: https://en.cppreference.com/w/cpp/language/static_assert (Counter argument: C++11 has templates and constexpr, which make static_assert more broadly useful than assert.True would be.)
Repository: neovim
Issue: UI: signcolumn (signs "gutter") on the right side
Labels: enhancement,ui-extensibility,column

Would it be possible to implement a signcolumn on the right side? Plugins could be build to use it as a scrollbar/minimap or as an indicator for warnings or highlighted search-results. Maybe it should be even possible to use both for indications and scrollbar like in modern guis/ides. Preferably, it should be general enough that it should be not limited to the usecases I mentioned. This also could be used for guis like oni.
Repository: flutter
Issue: Support persistant page offset for PageController
Labels: c: new feature,framework,f: scrolling,P3,team-framework,triaged-framework

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill our the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case

I have a `PageView` that I want to have a `viewportFraction` of 0.8, which does what I need, but the page is centered and I want to have the page aligned at the beginning of the view and then have a sort of 'peek' of the next page. 
In this case, the current page would take up 80% of the page and the beginning of the next page would take up the remaining 20%. 
<!--
     Please tell us the problem you are running into that led to you wanting
     a new feature.

     Is your feature request related to a problem? Please give a clear and
     concise description of what the problem is.

     Describe alternative solutions you've considered. Is there a package
     on pub.dev/flutter that already solves this?
-->

## Proposal
I believe this can be achieved by adding the offset value to the controller after the positions are calculated when using `animateToPage` and `jumpToPage`.
<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching images showing what you are imagining.

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->
## Expected Result: 
![Simulator Screen Shot - iPad Pro (9 7-inch) - 2019-10-12 at 18 02 32](https://user-images.githubusercontent.com/23037821/66709561-d54cf080-ed1b-11e9-8eae-2a8eda5d2919.png)
## Actual: 
![Simulator Screen Shot - iPad Pro (9 7-inch) - 2019-10-12 at 18 02 27](https://user-images.githubusercontent.com/23037821/66709562-daaa3b00-ed1b-11e9-88fe-885b6271d509.png)
Repository: TypeScript
Issue: tsc --watch initial build 3x slower than tsc
Labels: Needs Investigation,Domain: Performance,Fix Available,Rescheduled

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.7.0-dev.20191011, 3.6.4, 3.5.2

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** 
DeepReadonly
slow watch mode

**Code**

The slowness occurs on a codebase of around 1000 files. I can't distill it into a repro, but I can show the type that causes the slowness and an alternate type that does not.

I noticed the slowness when I replaced our implementation of `DeepReadonly` with the one from `ts-essentials`. One thing I should note in case it is helpful, is that in our codebase `DeepReadonly` is only used about 80 times. It's also used nested in some instances, a DeepReadonly type is included as a property of another DeepReadonly type, for example.

Here is the type from `ts-essentials`:

```ts
export type Primitive = string | number | boolean | bigint | symbol | undefined | null;
/** Like Readonly but recursive */
export type DeepReadonly<T> = T extends Primitive
  ? T
  : T extends Function
  ? T
  : T extends Date
  ? T
  : T extends Map<infer K, infer V>
  ? ReadonlyMap<K, V>
  : T extends Set<infer U>
  ? ReadonlySet<U>
  : T extends {}
  ? { readonly [K in keyof T]: DeepReadonly<T[K]> }
  : Readonly<T>;
interface ReadonlySet<ItemType> extends Set<DeepReadonly<ItemType>> {}
interface ReadonlyMap<KeyType, ValueType> extends Map<DeepReadonly<KeyType>, DeepReadonly<ValueType>> {}
```

Here is ours:

```ts
export type Primitive = number | boolean | string | symbol
export type DeepReadonly<T> = T extends ((...args: any[]) => any) | Primitive
  ? T
  : T extends _DeepReadonlyArray<infer U>
  ? _DeepReadonlyArray<U>
  : T extends _DeepReadonlyObject<infer V>
  ? _DeepReadonlyObject<V>
  : T
export interface _DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
export type _DeepReadonlyObject<T> = {
  readonly [P in keyof T]: DeepReadonly<T[P]>
}
```

**Expected behavior:**

Both types, when used in our codebase would take a similar amount of time for both a `tsc` and the initial build of `tsc --watch`. 

**Actual behavior:**

Our original `DeepReadonly` takes about 47 seconds to build using `tsc`. The initial build with `tsc --watch` also takes a similar amount of time, around 49 seconds.

With the `ts-essentials` version, a `tsc` build takes around 48 seconds. The initial build with `tsc --watch` takes anywhere from 3-5 minutes.

**Playground Link:** 

N/A

**Related Issues:** 

None for sure.
Repository: vue
Issue: transition-group with duration property doesn't work
Labels: feature request,discussion,transition

### Version
2.6.10

### Reproduction link
[https://codesandbox.io/s/vue-template-lcrsy](https://codesandbox.io/s/vue-template-lcrsy)







### Steps to reproduce
Click "Move" button.

### What is expected?
Both two lists move with animation.

### What is actually happening?
Only second list which is applied duration with css has animation.

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: TypeScript
Issue: --noEmitOnError trace has incorrect number of errors
Labels: Bug

**TypeScript Version:**  3.6.4 (also tested typescript@next)

**Search Terms:** noEmitOnError

**Code**
```ts
const x: string = 5;
```
```json
{
  "compilerOptions": {
    "noEmitOnError": true
  },
  "include": [
    "lib"
  ]
}
```

**Expected behavior:** Error number is 1.

**Actual behavior:** Error number is 2 when `--noEmitOnError` is enabled.
```
c:\Users\Username\Documents\projects\typescript_next>npx tsc
lib/test.ts:1:7 - error TS2322: Type '5' is not assignable to type 'string'.

1 const x: string = 5;
        ~


Found 2 errors.


c:\Users\Username\Documents\projects\typescript_next>npx tsc
lib/test.ts:1:7 - error TS2322: Type '5' is not assignable to type 'string'.

1 const x: string = 5;
        ~


Found 1 error.
```

**Playground Link:**

**Related Issues:**
Repository: go
Issue: x/net/http2: ability to access raw HTTP/2 stream
Labels: NeedsInvestigation,FeatureRequest

I am interested in creating a HTTP proxy (note: _not_ a reverse proxy) in Go. I'm only interested in implementing the `CONNECT` method. All other methods are irrelevant for me. https://github.com/elazarl/goproxy comes very close to what I want to do, but I'm also interested in [supporting `CONNECT` when client is connected to proxy using HTTP/2](https://github.com/elazarl/goproxy/issues/361). AFAIK, according to RFC7540, `CONNECT` over HTTP/2 [should work by hijacking the stream and do TCP tunneling over it](https://httpwg.org/specs/rfc7540.html#CONNECT).

[*http2responseWriter does not implement http.Hijacker](#14797). One idea, would be that it implements `http.Hijacker` which will give access not to the underlying TCP connection but rather the HTTP stream.

...or is there any other approach I could take without having to implement low-level HTTP/2 stuff?
Repository: flutter
Issue: Add Tap Handlers to `TableRow`
Labels: c: new feature,framework,f: gestures,P2,team-framework,triaged-framework

## Use case

While laying out a drawer menu I decided to give Table a try because it seems a good fit if you want to show icons before the entries, sometimes another icon behind in a regular grid.

When the user wants to select a menu entry it should be possible that he taps anywhere on the Row.
Adding GestureDetectors for every cell seems not a good solution

IMHO the use case to make w whole row selectable is quite common for instance highlightning a row on tap.

## Proposal

Add an OnTap handler to TableRows that adds a GestureDetector to a row is a Handler is set.
Repository: neovim
Issue: Backup file creation depends on umask and permissions of file
Labels: security,core

To reproduce:

- Create two files a and b with permissions 664 and 644 respectively \
- set `umask` to `0022`
```bash
touch a b
chmod 664 a
chmod 644 b
umask 0022
```

- Edit the files in vim with `backup` enabled and `backupdir` set to a nonexistent directory `foo`
- Observe that vim is unable to *write* to a backup file when writing `a`
- Observe that vim is unable to *make* a backup file when writing `b` (a different error)
- I would expect the behaviour to be the same between `a` and `b`, both failing with E510
```bash
vim -u NONE --cmd "set backup" --cmd "set backupdir=./foo//" --cmd "e a" --cmd w --cmd q -Vlog && cat log | grep ^E; rm log
# E506: Can't write to backup file (add ! to override) (libuv error no such file or directory)
vim -u NONE --cmd "set backup" --cmd "set backupdir=./foo//" --cmd "e b" --cmd w --cmd q -Vlog && cat log | grep ^E; rm log
# E510: Can't make backup file (add ! to override)
```

- Create the directory `foo`
- Observe that backup creation works as expected
```bash
mkdir foo
vim -u NONE --cmd "set backup" --cmd "set backupdir=./foo//" --cmd "e a" --cmd w --cmd q -Vlog && cat log | grep ^E; rm log
# No output
vim -u NONE --cmd "set backup" --cmd "set backupdir=./foo//" --cmd "e b" --cmd w --cmd q -Vlog && cat log | grep ^E; rm log
# No output
```

- Edit the files in vim with `backup` enabled and `backupdir` set to a nonexistent directory `bar` followed by an existing directory `foo`
- Observe that although `b` is able to write a backup file in `foo`, `a` is not
- I would expect both files to be able to be backed up in `foo`
```bash
vim -u NONE --cmd "set backup" --cmd "set backupdir=./bar//,./foo//" --cmd "e a" --cmd w --cmd q -Vlog && cat log | grep ^E; rm log
# E506: Can't write to backup file (add ! to override) (libuv error no such file or directory)
vim -u NONE --cmd "set backup" --cmd "set backupdir=./bar//,./foo//" --cmd "e b" --cmd w --cmd q -Vlog && cat log | grep ^E; rm log
# No output
```

- Repeat the above with `umask` set to `0002`
- Observe that backup files for both `a` and `b` are created in `foo`
when it is available and that both invocations fail with E510 with `foo`
is not present

The most buggy part here is that when an existing backup directory is
preceded with a missing one then no backup is created and E506 is
raised when `umask=0022` and the file being edited has permissions 0664.

At the very least I think `E506` should be documented with a pointer to
check file permissions and `umask`.

The execution path diverges
[here](https://github.com/neovim/neovim/blob/9af0fe529d2d91640e4d3388ab9f28159553f14c/src/nvim/fileio.c#L2693)
because `file_info.stat.st_mode != perm`. This is speculation: but
because the only side effect of that comparison passing is that
`backup_copy` becomes `true` the implication is that `backup_copy` is
actually broken entirely.
Repository: vue
Issue: Error compiling long string litteral  (many + on many lines)
Labels: bug,has workaround

### Version
2.6.10

### Reproduction link
[https://codesandbox.io/embed/vue-template-ysl83](https://codesandbox.io/embed/vue-template-ysl83)

### Steps to reproduce
Just click the link and you see the error and start editing.
Go to the second of the component and you see a red line (line no 24?)
It says that the string literal is not correct, but its because it loads just a piece of it.

### What is expected?
No compilation error

### What is actually happening?
A compilation error

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: flutter
Issue: How to create complex route transitions?
Labels: framework,a: animation,d: examples,c: proposal,P3,team-framework,triaged-framework

By complex animation I mean is that it not only transits to a new route, but also does something on an old route. For example, in every app (both android and iOS) it is considered a good practice to have a transition, which pushes new route from right and old route goes a bit to left and dims.

Your dev guides and API docs seem to be not touching this topic at all, googling also gave me no answers and that badly surprised me because it's such a basic thing in almost every native application.

[Stackoverflow question](https://stackoverflow.com/questions/58359812/how-to-make-listview-preserve-its-scroll-when-transitioning-to-another-route)
Repository: godot
Issue: Particles2D don't disable emitting after one-shot, when starting off-screen
Labels: bug,topic:rendering,confirmed,topic:particles

**Godot version:**
3.2 alpha2

**Issue description:**
When you create Particles2D, enable `one_shot` and start emitting when particles are outside visible radius, the emitting is never disabled and will start only when particles are again on screen. This is annoying, because I wan't to e.g. play explosion, but are too far to see it and then it will happen when I get close, even though it should be already finished. One shot should affect emitting whether particles are rendering or not.

**Steps to reproduce:**
1. Create Particles2D
2. Enable `one_shot`
3. Pan viewport away from particles
4. Enable `emitting`
5. Wait a bit
6. Pan to particles again
7. They will start emitting only then :<
Repository: terminal
Issue: Defer initial terminal sizing until terminal initialization
Labels: Help Wanted,Area-Rendering,Area-UserInterface,Product-Terminal,Issue-Task

Right now the initial window size is calculated just as the window is created but before the terminal is. This has two disadvantages:
1. It doesn't have all the size information. Right now its only the width of a scrollbar that it has to guess but there could be more (potentially variable size) elements in the future. There might also be some additional spacing in layers above, like pane or terminal page.
2. It creates temporary `DxRenderer` just to locate required fond and calculate its size and then discards it.

If we instead calculated the initial size when terminal initializes this problems would be gone (it would be able to query sizes of the controls and use the real renderer of a terminal). We might potentially resolve them otherwise but this seems to be the simplest and most robust approach.

The problem is that it could result in two sizing operations (one when window opens and another one when the size is calculated) which could be noticeable to user or CPU, unless this can be somehow avoided. Thus I'm here to ask what do you think about this approach.
Repository: go
Issue: encoding/gob: type information missing from nested ignored interfaces
Labels: NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
> println(runtime.Version())
go1.13.1
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<pre>
https://play.golang.org
</pre></details>

### What did you do?

I encoded a struct with multilevel nested interfaces, and then tried to ignore the encoded value when decoding.

https://play.golang.org/p/L0f2hXG46yx

### What did you expect to see?

Decoding the stream to have been successful with type information from both nested interfaces received, while ignoring the first value.

### What did you see instead?

`gob: bad data: field numbers out of bounds`

Also, the function `ignoreInterface` does not descend into its fields even if the concrete type name is registered. Without descending into the concrete type, it will not be able to get type information from any more interfaces nested inside the concrete type.
https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/encoding/gob/decode.go#L692
Repository: godot
Issue: Android deploy with Remote Debug or Network FS doesn't work over Wi-Fi
Labels: bug,platform:android,topic:editor,confirmed,topic:network

**Godot version:**

master (1fed266bf)

**OS/device including version:**

Host: Arch Linux, 64bit
Android Device: Oculus Quest, 9.0.0

**Issue description:**

The short version is `adb reverse ...` doesn't work over the network for some reason due to an [adb bug](https://issuetracker.google.com/issues/37066218) and we attempt to use it even if we're connected over the network.

The long version is in the steps to reproduce below.

Godot console shows that reverse fails with a non-zero status.

> Installing to device (please wait...): Oculus Quest
> --- Device API >= 21; debugging over USB ---
> --- DEVICE API >= 21; DEBUGGING OVER USB ---
> Reverse result: 1

`adb reverse` seems to always error with
>adb: error: more than one device/emulator

when connected wirelessly, even when used outside Godot, and even when there is only one device in `adb devices`.

**Steps to reproduce:**

Attempt to debug a project on an android device over the network (instead of USB).

1. Connect newish android device with ADB over tcpip
   1. Connect android device that uses at least API level 22 via USB.
   2. `adb tcpip 5555`
   3. `adb connect x.x.x.x:5555` (android device's ip)
   4. Unplug from USB.
2. Enable "Deploy with Remote Debug" and/or "Small Deploy with Network FS" from the "Debug" menu.
3. Deploy and run a project via the android button in the top-right corner of the UI.

Expected behavior:
* If Remote Debug enabled:
   * breakpoints pause execution
* If Small Deploy with Network FS enabled:
   * project runs

Actual behavior:
* If Remote Debug enabled:
   * breakpoints do nothing
* If Small Deploy with Network FS enabled:
   * error message on device instead of running

**Minimal reproduction project:**
N/A

Related to changes in #10792
Repository: flutter
Issue: [local_auth] stickyAuth causes IllegalStateException
Labels: c: crash,platform-android,p: local_auth,package,P2,c: fatal crash,team-android,triaged-android

I'm receiving crash in Crashlytics with following stack trace:
```
Fatal Exception: java.lang.IllegalStateException
Can not perform this action after onSaveInstanceState
androidx.fragment.app.FragmentManagerImpl.checkStateLoss (FragmentManagerImpl.java:1536)
androidx.biometric.BiometricPrompt.authenticate (BiometricPrompt.java:658)
io.flutter.plugins.localauth.AuthenticationHelper$1.run (AuthenticationHelper.java:172)
android.os.Handler.handleCallback (Handler.java:789)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
```
It's not device/OS specific, (Android 6/7/8, manufacturers Samsung, Xioami, ZTE, LG and others)

Code that I'm using:
```dart
  @override
  void initState() {
    super.initState();
    _auth();
  }

  void _auth() {
    localAuth.authenticateWithBiometrics(
      localizedReason: "App is locked",
      stickyAuth: true,
    ).then((x) {
      if (x)
        Navigator.of(context).pushReplacementNamed('/home');
    }).catchError((e) {
      if (++retries < 10)
        _auth();
    });
  }
```
I'm using local_auth 0.6.0+1