sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Signatures of intersection/union types properties
Labels: Suggestion,Needs Proposal

Consider next example:

```
interface A{
    f:string;
    set_f(val:string) : void;
    get_f() : string;
}

interface B{
    f:number;
    set_f(val:number) : void;
    get_f() : number;
}

let n:number;
let str:string

let first : A&B;
first.f = n; // error, as f has type number&string. Probably OK, but probably it should be number|string, to be symmetric with set_f function.
first.f = str; // error, as f has type number&string.
n = first.f;
str = first.f;

first.set_f(n);
first.set_f(str);
n = first.get_f(); // error, typescript prefer to use first signature () => string. Shouldn't it be string&number.
str = first.get_f();

let second : A|B;
second.f = n; // Ops, no error! But it should be at least string&number here
second.f = str;// Ops, no error! But it should be at least string&number here
n = second.f; // error, typescript prefer to use first signature string. It should be string|number
str = second.f;// Ops, no error, typescript prefer to use first signature string. It should be string|number

second.set_f(n); //error, lack a call signature. It's really good, but better if it would be (string&number) => void
second.set_f(str); //error, lack a call signature. 
n = second.get_f(); // error, cool, typescript was able to correctly infer result as string|number
str = second.get_f();// error, cool, typescript was able to correctly infer result as string|number
```

With #9167 additional to previous was added preserving readonly flag for intersection. Should't readonly flag be reset if any of intersection member has no such flag? As intersection should extend possibilities of type, and never narrow down it.
Repository: TypeScript
Issue: [FEATURE REQUEST] Please supply a minified version with only transpilation functionality 
Labels: Suggestion,Help Wanted,API

Please supply a minified version (inc npm). Please also let this be a new js file with only parts needed for transpilation.

This will aid our in-browser usages.

thanks
Repository: go
Issue: cmd/compile: do front-end constant evaluation across simple inlined function boundaries
Labels: Performance,NeedsFix,compiler/runtime

``` go
func i(x int) int { return x }

func f(a int) bool {
    switch a {
    case 1, 2, 3, 4, 5, 6:
        return true
    }
    return false
}

func g(a int) bool {
    switch a {
    case i(1), i(2), i(3), i(4), i(5), i(6):
        return true
    }
    return false
}
```

f and g should compile to the same code. They don't. In g, i(n) is not recognized as a constant case, because i(n) ends up being a tempname introduced to hold the inlined return value from i. As a result, g does not use binary search over the cases. The SSA back-end can see past such things, but several important optimization decisions are made in the front-end on a const/non-const basis.

As a first pass, maybe recognized inlined functions containing exactly one return statement and inline the returned expression directly. This may also require work to avoid converting inlined arguments from constants to tempnames, which itself might be useful.

Sample real world code in which this occurs, from asm9.go in the s390x obj code:

``` go
func OPVCC(o uint32, xo uint32, oe uint32, rc uint32) uint32 {
    return o<<26 | xo<<1 | oe<<10 | rc&1
}

func opform(ctxt *obj.Link, insn uint32) int {
    switch insn {
    default:
        ctxt.Diag("bad insn in loadform: %x", insn)
    case OPVCC(58, 0, 0, 0), // ld
        OPVCC(58, 0, 0, 0) | 1<<1, // lwa
        OPVCC(62, 0, 0, 0):        // std
        return DS_FORM
    case OP_ADDI, // add
        OPVCC(32, 0, 0, 0), // lwz
        OPVCC(42, 0, 0, 0), // lha
        OPVCC(40, 0, 0, 0), // lhz
        OPVCC(34, 0, 0, 0), // lbz
        OPVCC(50, 0, 0, 0), // lfd
        OPVCC(48, 0, 0, 0), // lfs
        OPVCC(36, 0, 0, 0), // stw
        OPVCC(44, 0, 0, 0), // sth
        OPVCC(38, 0, 0, 0), // stb
        OPVCC(54, 0, 0, 0), // stfd
        OPVCC(52, 0, 0, 0): // stfs
        return D_FORM
    }
    return 0
}
```
Repository: TypeScript
Issue: Suggestion: Upper-bound generic type constraints
Labels: Suggestion,Awaiting More Feedback

This is a proposal for generic structural supertype constraints.

I'll first detail the proposal, and then get into a discussion about use-cases.
## Proposal

A supertype constraint is a constraint on a generic type parameter to be the structural _supertype_ of another type. It's like a subtype/inheritance constraint, but from the other direction. For example, let's say we have a square:

```
interface Square {width : number; height : number}
```

In this suggested syntax, you could write:

```
performAction<T extended by Square>(partialSquare : T) {}
```

This means the type `T` must be a structural supertype of square. So the potential candidates for `T` are:

```
{width : number}, {height : number}, Square, {}
```

It's an established kind of type constraint, not something I just made up. Although it's not exactly common, some languages do implement this feature, such as Scala. In Scala, you can write:

```
def performAction[T >: Square](obj : T) = { ... }
```

To express a supertype/upper bound constraint. In this case, of course, the constraint isn't structural -- `T` must declare that it implements `Square`. 
## Utility

In most languages, including Scala, this kind of constraint isn't very useful. It only comes up in certain specific situations. 

However, Javascript libraries often have this kind of API, where you're allowed to specify the partial properties of an object to modify it (the rest remain at their previous value).

In many cases, you can support this by having optional interface members, but isn't always possible or correct.

An important example is React, which defines a method called `setState`:

```
class Component {
    var state;

    setState(partialState) {
        //merges the properties of partialState with the current state.
    }
}
```

The right signature for this method should be:

```
class Component<Props, State> {
    setState<PartialState extended by State>(partialState : PartialState) {
        //merges the properties of partialState with the current state.
    }
}
```

Currently,the definition files state that it is:

```
setState(fullState : State) {
    //merges the properties of partialState with the current state.
}
```

Which doesn't fully capture the functionality of the method.
## Notes

The suggested syntax doesn't give us a nice way of combining both subtype and supertype constraints. One possibility is:

```
exampleMethod<T extends LowerBound and extended by UpperBound>
```
Repository: TypeScript
Issue: Rename doesn't work for string literal compared to string literal type
Labels: Bug

In the below, try to rename `"ADD_TODO"` in the case clause. It fails.

``` ts
interface AddTodo {
    type: "ADD_TODO";
    text: string;
}

interface DeleteTodo {
    type: "DELETE_TODO";
    position: number
    newText: string;
} 

type TodoAction = AddTodo | DeleteTodo;

function dispatchOrSomething(action: TodoAction) {
    switch (action.type) {
        case "ADD_TODO":
            break;
        case "DELETE_TODO":

    }
}
```
Repository: go
Issue: cmd/compile: poor register allocator behavior in compression code
Labels: Performance,NeedsFix,compiler/runtime

Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
   go1.6 windows/amd64 and go1.7beta1 windows/amd64
2. What operating system and processor architecture are you using (`go env`)?
   set GOARCH=amd64
   set GOBIN=
   set GOEXE=.exe
   set GOHOSTARCH=amd64
   set GOHOSTOS=windows
   set GOOS=windows
   set GOPATH=E:\Users\fred\Documents\Prog\kanzi\go
   set GORACE=
   set GOROOT=E:\Program Files\go
   set GOTOOLDIR=E:\Program Files\go\pkg\tool\windows_amd64
   set GO15VENDOREXPERIMENT=1
   set CC=gcc
   set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
   set CXX=g++
   set CGO_ENABLED=1
3. What did you do?
   I ran "go build TestZRLT.go" then "TestZRLT.exe" both for Go 1.6 and 1.7 beta1
   The source code is very simple: https://github.com/flanglet/kanzi/blob/master/go/src/kanzi/test/TestZRLT.go. 
   It runs a correctness and a performance test tor the Zero Run Length Transform:
   https://github.com/flanglet/kanzi/blob/master/go/src/kanzi/function/ZRLT.go.
4. What did you expect to see?
   I expected to see no performance regression from 1.6 to 1.7beta1
5. What did you see instead?
   ZRLT encoding is much faster with 1.7beta1 but decoding is much slower.

Output for 1.6:
Speed test
Iterations: 50000

ZRLT encoding [ms]: 10694
Throughput [MB/s]: 222
ZRLT decoding [ms]: 7419
Throughput [MB/s]: 321

ZRLT encoding [ms]: 10753
Throughput [MB/s]: 221
ZRLT decoding [ms]: 7472
Throughput [MB/s]: 319

ZRLT encoding [ms]: 10724
Throughput [MB/s]: 222
ZRLT decoding [ms]: 7393
Throughput [MB/s]: 322

Output for 1.7beta1:
Speed test
Iterations: 50000

ZRLT encoding [ms]: 6834
Throughput [MB/s]: 348
ZRLT decoding [ms]: 11560
Throughput [MB/s]: 206

ZRLT encoding [ms]: 6828
Throughput [MB/s]: 349
ZRLT decoding [ms]: 11589
Throughput [MB/s]: 205

ZRLT encoding [ms]: 6790
Throughput [MB/s]: 351
ZRLT decoding [ms]: 11558
Throughput [MB/s]: 206

I narrowed down the issue to the run length decoding loop:

```
for val <= 1 {
    runLength = (runLength << 1) | int(val)
    srcIdx++

    if srcIdx >= srcEnd {
            break
    }

    val = src[srcIdx]
}
```

If I replace 'for val <= 1 {' with 'for val&1 == val {', the decoding becomes much faster (although not as fast as with Go 1.6)

Output for 1.7beta1 with code change:

Speed test
Iterations: 50000

ZRLT encoding [ms]: 6800
Throughput [MB/s]: 350
ZRLT decoding [ms]: 7669
Throughput [MB/s]: 310

ZRLT encoding [ms]: 6813
Throughput [MB/s]: 349
ZRLT decoding [ms]: 7689
Throughput [MB/s]: 310

ZRLT encoding [ms]: 6775
Throughput [MB/s]: 351
ZRLT decoding [ms]: 7662
Throughput [MB/s]: 311
Repository: TypeScript
Issue: Show inherited comments in quick info
Labels: Suggestion,In Discussion,API,Domain: Quick Info,Experience Enhancement

TypeScript Version: 1.8.10

Have an interface in one file

```
interface IFooController {
    /**
     * random comment
     * @returns {string} Returns a string
     */
    test(): string;
}

export default IFooController;

```

In another file have a class that implements that interface

```

import IFooController from "../Interfaces/Controllers/IFooController";

export default class FooController implements IFooController {
    test(){

    }
}
```

**Expected behavior:**

See the comments of the interface when hover over the class method

**Actual behavior:** 

See nothing.

This doesn't happen with functions and class comments.
This only happens when interface is imported.

Using Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Repository: TypeScript
Issue: Find-all-references for `this` type
Labels: Bug

Do we want this? What things should count as references of the `this` type? The current class, or all subclasses too? Given:

```
class A {
    m(): this { ... }
    m2: this { ... }
}
class B extends A {}
const x: A = { m1() { ... }, m2() { ... } }
```

Should we include just the `this`es, or `A` too, or even `B` too? What about `x`?
Repository: opencv
Issue: SeamFinder->find breaking in GCGraph addEdges assertion, possibly due to RotationWarper giving negative corner points. Suspect either HomographyBasedEstimator or BundleAdjust causing CameraParams to allow for negative points.
Labels: bug,category: stitching,incomplete

### Please state the information for your system

Version 3.1, Windows 7, Visual Studio
### In which part of the OpenCV library you got the issue?

 stitching/imgproc. 
### Expected behaviour

The following line of code will run successfully:
SeamFinder->find(ImagesWarped, Corners, MasksWarped);
### Actual behaviour

The following line of code breaks with this error: Assertion failed (w>=0 && revw>=0) in GCGraph(float)::addEdges.
SeamFinder->find(ImagesWarped, Corners, MasksWarped);
### Additional description

In debug mode, the argument Corners in SeamFinder->find has negative x-coordinate values. Corners is a vector of opencv Point objects. This is suspected to be caused by either HomographyBasedEstimator or BundleAdjust setting the rotation matrix in a previously declared CameraParams value. That leads to the following intermediate step:

Corners[i] = Warper->warp(SeamScaleFunduses[i], K, Cameras[i].R, INTER_LINEAR, BORDER_REFLECT, ImagesWarped[i]);

Where Warper is a RotationWarper, and Cameras is a vector of the CameraParams object. Here the rotation matrix parameter of Cameras, .R, seems to be giving Corners Points with negative x coordinates.
Repository: three.js
Issue: firefox allocation size overflow editor publishing 1,5m+ polygons
Labels: Enhancement,Editor

##### Description of the problem

allocation size overflow when publishing a scene frome editor with over 1,5 million polygons, 1,1million still works fine

allocation size overflow
Menubar.File/<()
 Menubar.File.js:221
bound ()
 self-hosted:752
 Menubar.File.js:221:12
##### Three.js version
- [ ] Dev
- [x] r77
- [ ] ...
##### Browser
- [ ] All of them
- [ ] Chrome
- [x] Firefox
- [ ] Internet Explorer
##### OS
- [x] All of them
- [ ] Windows
- [ ] Linux
- [ ] Android
- [ ] IOS
##### Hardware Requirements (graphics card, VR Device, ...)
Repository: rust
Issue: An unused generic parameter should be a warning at the definition site.
Labels: A-lints,A-diagnostics,T-lang,T-compiler,C-feature-request

Consider the following code:

``` rust
fn foo<F>(x: i32) -> i32 { x }

fn bar<'a>(x: i32) -> i32 { x }

fn main() {
    bar(1);
    bar(2);
    foo::<f64>(3);
    foo(4);
    foo(5);
}
```

Currently, this causes a fatal compiler error at the invocation of `foo(4)` on line 9, of the form:

```
error: unable to infer enough type information about `_`; type annotations or generic parameter binding required [--explain E0282]
 --> <anon>:9:5
  |>
9 |>     foo(4);
  |>     ^^^

error: aborting due to previous error
```

The only way to ever successfully invoke `foo` is to feed it an explicit type (via the `::<_>` syntax as illustrated on line 8).

I suspect in many cases of this error, the actual problem is that the definition of `fn foo` (and also `fn bar`) are faulty: since `F` and `'a` are never referenced in the signature nor in the function body, they are irrelevant and should cause a warning via the compiler's linting system.

(A separate issue is that one cannot actually instantiate the `'a` parameter to `fn bar` via the `::<_>` syntax, so it seems that its formal lifetime parameter is truly unusable. But things may not remain that way forever, so I think its best to lump both of these cases into the same category.
Repository: go
Issue: cmd/compile: go1.7beta2 performance regression
Labels: Performance,NeedsFix,compiler/runtime

Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?

go version go1.6.2 darwin/amd64
go version go1.7beta2 darwin/amd64
1. What operating system and processor architecture are you using (`go env`)?

Intel i7-3540M (also tried on i7-2677M but didn't see the same regression)

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/30/6hyj4x_x783f12hmbcmn5tt00000gn/T/go-build183604977=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
1. What did you do?

https://play.golang.org/p/3WDEr-_QZR

Disassembly (-gcflags -S): https://gist.github.com/samuel/3053bafe149a0459322f6eeaf8bd5ae5
1. What did you expect to see?

Go 1.7beta2 the same performance or better than Go 1.6
1. What did you see instead?

benchmark                old ns/op     new ns/op     delta
BenchmarkVScaleF32-4     2906          3801          +30.80%
BenchmarkVMaxF32-4       2682          3951          +47.32%

benchmark                old MB/s     new MB/s     speedup
BenchmarkVScaleF32-4     1409.19      1077.37      0.76x
BenchmarkVMaxF32-4       1527.02      1036.64      0.68x
Repository: angular
Issue: DOM helper getKeyEvent does not use keyCode
Labels: type: bug/fix,freq1: low,area: core,core: event listeners,P3

I'm not sure if this is a bug with Angular or ChromeDriver yet, but here goes for the record:

Angular's browser dom adapter uses `event.key` in `getKeyEvent`. When WebDriver via ChromeDriver sends a `sendKeys` event, it fills out the event's `keyCode`, but not the `key`. This means that something such as `<button (keydown.arrowRight)="doTheThing()">` will not be triggered in an e2e test.

cc @robertmesserle
Repository: angular
Issue: Router: Feature Request: default 'router-link-active' class attachment (old router behaviour)
Labels: feature,freq3: high,area: router,feature: under consideration

**I'm submitting a ...** 

```
[ ] bug report
[x] feature request
[ ] support request
```

**Current behavior**

angular/router 3.0.0-alpha.7 introduced the `routerLinkActive` directive, which enabled us to set a custom class on the current `routerLink` element. This is great!

But AFAIK, I have to attach this routerLinkActive directive to EVERY SINGLE LINK.

eg

```
<ul>
    <li><a [routerLink]="['/sales']"    routerLinkActive="router-link-active" ...
    <li><a [routerLink]="['/reports']"  routerLinkActive="router-link-active" ...
    <li><a [routerLink]="['/search']"   routerLinkActive="router-link-active" ...
    <li><a [routerLink]="['/settings']" routerLinkActive="router-link-active" ...
    ...
</ul>
```

**Expected/desired behavior**

Angular should attach the class `router-link-active` automatically to all elements with `routerLink` directives if `routerLinkActive` is not present (i.e. overridden).

Then, all the user has to include is a custom `.router-link-active { }` CSS style and they get active link feedback for free! (just like the old router)

Alternatively, add an option to set `routerLinkActive="custom-class"` once only? Per app ? Per router ? Per parent element (i.e. the `<ul>`)?

Maybe the `routerLinkActive` selector can be updated to match `routerLink` elements. Or through `[routerLinkActiveOptions]="{autoapply: true}"` at the `<ul>` level or similar ?

**What is the motivation / use case for changing the behavior?**

Better developer experience. Just add one CSS style and get active link feedback for free. It was previous router behavior. Reduce template noise.

**Please tell us about your environment:**
- **Angular version:** 2.0.0-rc.3   +  angular/router 3.0.0-alpha.7
- **Language:**  TypeScript 1.8.10
Repository: go
Issue: cmd/yacc: remove hardcoded limits TEMPSIZE and NSTATES
Labels: NeedsFix

1.5 & 1.7rc2  on amd64 mac
1. What did you do?

go get github.com/snadrus/sqlin
cd $GOPATH/github.com/snadrus/sqlin/src/parse
go tool yacc -o parser.go -p parse parser.y
1. What did you expect to see?
   sql2003 spec becoming parser.go, or an actionable error.
2. What did you see instead?
   In Go 1.7rc2:
   panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x1124a0, 0xc42000e150)
    /usr/local/go/src/runtime/panic.go:500 +0x1a1
main.aryfil(0xc4200a6000, 0x7d0, 0x7d0, 0x883, 0x0)
    /usr/local/go/src/cmd/yacc/yacc.go:1522 +0x41
main.stagen()
    /usr/local/go/src/cmd/yacc/yacc.go:1781 +0x3f3
main.main()
    /usr/local/go/src/cmd/yacc/yacc.go:359 +0x5d
Repository: youtube-dl
Issue: Google Prompt TFA
Labels: request

- [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.06.20**
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
### What is the purpose of your _issue_?
- [ ] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [x] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---
### Description of your _issue_, suggested solution and other information

Using my phone to respond to login requests doesn't work, returning `RegexNotFoundError: Unable to extract Login GALX parameter` when attempting to login. This is contrary to the expected prompt on my phone to allow the login, bypassing the requirement for TFA codes.

View on desktop browser
![desktopsignin](https://cloud.githubusercontent.com/assets/10201206/16269276/e84ba074-3891-11e6-8409-e7a5ae1ad9b5.png)

Initial device confirmation
![screenshot_2016-06-22-15-55-49](https://cloud.githubusercontent.com/assets/10201206/16269372/45320eea-3892-11e6-9f17-324b0d06f202.png)

Challenge request
![screenshot_2016-06-22-15-56-03](https://cloud.githubusercontent.com/assets/10201206/16269377/490235f4-3892-11e6-92de-d99dea4061ef.png)
Repository: go
Issue: runtime/cgo: panic from callbacks does not work with -fsanitize=address/thread
Labels: help wanted,NeedsFix

Version: `go1.6 darwin/amd64`

```
==976==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff5fbfefb1 at pc 0x00000573e1bb bp 0x7fff5fbfef10 sp 0x7fff5fbfe6c0
WRITE of size 5 at 0x7fff5fbfefb1 thread T0
```

As far as I can tell, this is all that's happening:

In go,

```
msg := C.String("fixme")
```

In c++,

```
std::string str(msg);
```

But maybe I'm missing something obvious.

Have a look,
https://travis-ci.org/keroserene/go-webrtc/jobs/139389584

I've only been able to reproduce this w/ clang.

/cc @dvyukov
Repository: go
Issue: x/exp/shiny: MacOS driver does not fire mousewheel events with single or slow clicks
Labels: NeedsInvestigation

Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?

go version go1.6.2 darwin/amd64
1. What operating system and processor architecture are you using (`go env`)?
   GOARCH="amd64"
   GOBIN=""
   GOEXE=""
   GOHOSTARCH="amd64"
   GOHOSTOS="darwin"
   GOOS="darwin"
   GOPATH="/Users/driusan/Code/Go"
   GORACE=""
   GOROOT="/usr/local/go"
   GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
   GO15VENDOREXPERIMENT="1"
   CC="clang"
   GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
   CXX="clang++"
   CGO_ENABLED="1"
2. What did you do?
   If possible, provide a recipe for reproducing the error.
   A complete runnable program is good.
   A link on play.golang.org is best.

Ran x/exp/shiny/example/basic, scrolled mouse a single click with the scroll wheel on a mouse
1. What did you expect to see?

Output similar to:

got mouse.Event{X:824, Y:452, Button:-1, Modifiers:0x0, Direction:0x0}

in the console.
1. What did you see instead?

Nothing.

Adding some debug statements, it seems that the issue is that this line:

`for delta := int(dy); delta != 0; delta--`

in `driver/gldriver/cocoa.go:/func mouseEvent/` isn't iterating at all when dy < 1 and the conversion is rounding to 0 when it casts to an int.

Changing it to:
`for delta := int(math.Ceil(float64(dy))); delta != 0; delta--`

if a little inelegant, fixed the issue for me.