sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: proposal: spec: type inferred composite literals
Labels: LanguageChange,Proposal,LanguageChangeReview

Composite literals construct values for structs, arrays, slices, and maps. They consist of a type followed by a brace-bound list of elements. e.g.,

``` go
x := []string{"a", "b", "c"}
```

I propose adding untyped composite literals, which omit the type. Untyped composite literals are assignable to any composite type. They do not have a default type, and it is an error to use one as the right-hand-side of an assignment where the left-hand-side does not have an explicit type specified.

``` go
var x []string = {"a", "b", "c"}
var m map[string]int = {"a": 1}

type T struct {
  V int
}
var s []*T = {{0}, {1}, {2}}

a := {1, 2, 3} // error: left-hand-type has no type specified
```

Go already allows the elision of the type of a composite literal under certain circumstances. This proposal extends that permission to all occasions when the literal type can be derived.

This proposal allows more concise code. Succinctness is a double-edged sword; it may increase or decrease clarity. I believe that the benefits in well-written code outweigh the harm in poorly-written code. We cannot prevent poor programmers from producing unclear code, and should not hamper good programmers in an attempt to do so.

This proposal may slightly simplify the language by removing the rules on when composite literal types may be elided.
## Examples

Functions with large parameter lists are frequently written to take a single struct parameter instead. Untyped composite literals allow this pattern without introducing a single-purpose type or repetition.

``` go
// Without untyped composite literals...
type FooArgs struct {
  A, B, C int
}
func Foo(args FooArgs) { ... }
Foo(FooArgs{A: 1, B: 2, C:3})

// ...or with.
func Foo(args struct {
  A, B, C int
}) { ... }
Foo({A: 1, B: 2, C: 3})
```

In general, untyped composite literals can serve as lightweight tuples in a variety of situations:

``` go
ch := make(chan struct{
  value string
  err   error
})
ch <- {value: "result"}
```

They also simplify code that returns a zero-valued struct and an error:

``` go
return time.Time{}, err
return {}, err // untyped composite literal
```

Code working with protocol buffers frequently constructs large, deeply nested composite literal values. These values frequently have types with long names dictated by the protobuf compiler. Eliding types will make code of this nature easier to write (and, arguably, read).

``` go
p.Options = append(p.Options, &foopb.Foo_FrotzOptions_Option{...}
p.Options = append(p.Options, {...}) // untyped composite literal
```
Repository: go
Issue: x/net/trace: no way to know whether Finish has been called
Labels: NeedsInvestigation

@Sajmani 
The current trace package does not provide a way for the caller of trace.FromContext to know whether trace.Trace.Finish has been called on this Trace (usually by another goroutine) so that the caller may operate on a finished Trace.
Repository: kubernetes
Issue: kubelet should treat each pod source independently
Labels: priority/backlog,sig/node,kind/feature,lifecycle/frozen,area/pod-lifecycle

Right now kubelet waits until all sources are ready before deleting pods, so that it wouldn't accidentally kill desired pods from not ready sources (bug to-be-fixed by PR: #15167). 
What kubelet should do is to treat each source independently, i.e., if a source is ready, we can sync _and_ clean up pods from that source.
In order to do this, kubelet needs to be able to recognize which source the pod (container) even after restarting. There are two options:
- checkpointing: see https://github.com/kubernetes/kubernetes/issues/15122#issuecomment-145926227 and the original checkpointing issue #489
- write it as a docker label (#15089); we'll need to do similar thing for rkt too.

/cc @dchen1107 @thockin
Repository: TypeScript
Issue: "Cannot find module" message should be more explicit, saying where it's looking
Labels: Suggestion,Help Wanted

With all the vagaries around module loading, it'd be great to give a more verbose, helpful error message for "Cannot find module 'foo'", saying where the compiler looked for the module.   That can help clue the user into (1) how TypeScript works and (2) how to fix their issue.

The message text could be semi-static, maybe something like:   IF using commonjs loading AND path isn't relative THEN say "Couldn't find module Foo; searched node_modules directory off directory XXXX and its ancestors and the package.json Typings path YYYY.

Better doc around the module loading algorithm helps, but just putting some of that info in the error message makes it very easily discovered.   It also helps clue the user into what isn't the problem (e.g. the message above confirms that using commonjs module loading & found Typings in package.json, but something else seems to be the problem).
Repository: material-ui
Issue: [Snackbar] Add stacking support/display several
Labels: new feature,component: snackbar,priority: important

## Summary 💡

Place multiple snack bars on the page.

## Examples 🌈

<img width="310" alt="Capture d’écran 2020-09-04 à 15 41 59" src="https://user-images.githubusercontent.com/3165635/92245839-326a0b80-eec5-11ea-87f5-fbcbc3f808f1.png">

## Motivation 🔦

Will the material design specification discourages to display multiple snackbar, and could stay the default, display multiple is a common use case:

> Only one snackbar may be displayed at a time.

https://material.io/components/snackbars#usage

## Benchmark

- https://trello.com/c/tMdlZIb6/1989-snackbar-more-features
- https://react-hot-toast.com/
- https://mantine.dev/others/notifications/
- https://blueprintjs.com/docs/#core/components/toast
- https://seek-oss.github.io/braid-design-system/components/useToast
- https://github.com/fkhadra/react-toastify
- https://chakra-ui.com/toast
- https://ant.design/components/message/
- https://github.com/iamhosseindhv/notistack/
- https://sancho-ui.com/components/toast/
- https://evergreen.segment.com/components/toaster
- https://twitter.com/railto/status/1232997843020996610
- https://baseweb.design/components/toast/
- https://toasted-notes.netlify.com/
- https://github.com/kylecesmat/react-cheers
- https://jossmac.github.io/react-toast-notifications/
- https://github.com/mui-org/material-ui/issues/21053#issuecomment-630119128
- https://twitter.com/listenMrUtkarsh/status/1283480376904568833
Repository: TypeScript
Issue: typescript checking frontend template files
Labels: Suggestion,Needs Proposal

The greatest feature of TypeScript, in terms of big enterprise apps, is type checking. When modifying/extending something low-level, I'll get all errors that arise beneath - just like I would in Java and .Net. But this relates to TS code.

My question is: **is it possible to use TypeScript to check types used in frontend templating engines, such as Handlebars, Underscore or [your favourite templating engine]**?
I've read that [TypeScript 1.6 is gonna support react's JSX](https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript), but it's a big limitation to one specific engne only. I guess there is no built-in platform-supported solution, but maybe there is someone who made it work somehow?

Or, in other words, what would you do if you wanted to use TypeScript to check types of variables in handlebars/underscore templates?
Repository: go
Issue: x/mobile: dedicated publish.Event type?
Labels: mobile

Moving a TODO from example/basic to an issue.

Should app code running a fast draw loop use a.Send(paint.Event{})? Should we have a dedicated publish.Event type? Should App.Publish take an optional event sender and send a publish.Event?
Repository: angular
Issue: Proposal: A directive should not receive events that it fired
Labels: type: bug/fix,effort1: hours,freq1: low,area: core,state: confirmed,core: event listeners,core: inputs / outputs,design complexity: major,P3

E.g.

```
export class Checkbox {
  @Output() change: EventEmitter = new EventEmitter(); 

  @HostListener('change', [
        '$event.target.value'
   ])
   onChange(event) { ... }
}
```
Repository: rust
Issue: Rust tries to be too helpful with impl suggestions, sometimes being unhelpful
Labels: C-enhancement,A-diagnostics,T-compiler,F-on_unimplemented,D-confusing

[This code example](http://is.gd/riFsRe) is a simplified extraction of part of the hierarchy that I'm working on for https://github.com/sgrif/yaqb. It's still a bit contrived, but I think it really gets the point across about how unhelpful/nonsensical the resulting error message is. 

The type structure goes like this: `AsExpression` represents a type which can be converted to an `Expression` which would return a given type. `Expression` represents... well, an expression. `AsExpression` gets a blanket impl for any type which implements `Expression`. `Column` represents a concrete column (which in the real code has other things associated to it). Ultimately the column has a type, and can be used as an expression of that type. Any type that implements `Column` gets a blanket impl for `Expression`.

In `main`, we're trying to compare a column representing an `i32`, to a `str`. This is incorrect, and should fail to compile. However, the error message we get out of this is:

> error: the trait `Column` is not implemented for the type `&str` [E0277]

In the context of a SQL database, and what `Column` means, this is a nonsense error, and would not be helpful to the user in seeing why their code is failing to compile. Rust is just being super clever and realizing that the blanket impls would apply if we just implement that instead. I'd like to propose changing the error message to something with a bit more information, such as:

> error: the trait `AsExpression<i32>` is not implemented for the type `&str` [E0277]
> 
> A blanket implementation of `AsExpression`, located at <file_path>:<line_number> could apply if `Column` were implemented for the type `&str`
Repository: rust
Issue: associated type not normalized when a where-clause is present
Labels: A-trait-system,P-low,A-associated-items,T-lang,C-bug

## Affected Versions

At least 1.3, 1.4, `rustc 1.5.0-nightly (11a612795 2015-10-04)`
## STR

``` Rust
trait Foo { type Bar; }
impl<T> Foo for T { type Bar = u64; }
fn foo<T>() -> <T as Foo>::Bar
    where T: Foo // <- the code compiles if this is removed
{ 1 }
fn main() {}
```
## Expected Result

the code should compile
## Actual Result

```
<anon>:7:14: 7:15 error: mismatched types:
 expected `<T as Foo>::Bar`,
    found `_`
(expected associated type,
    found integral variable) [E0308]
<anon>:7     x = Some(1);
                      ^
```

cc @nikomatsakis
Repository: youtube-dl
Issue: Failing to download PBS video
Labels: geo-restricted

When trying to download http://www.pbs.org/wgbh/nova/tech/making-stuff.html#making-stuff-stronger I get an error. Here's the debug output:

```
--verbose http://www.pbs.org/wgbh/nova/tech/making-stuff.html#making-stuff-stronger
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'http://www.pbs.org/wgbh/nova/tech/making-stuff.html#making-stuff-stronger']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.10.06.2
[debug] Python version 2.7.10 - Darwin-14.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.8, ffprobe 2.8, rtmpdump 2.4
[debug] Proxy map: {}
[PBS] making-stuff: Downloading webpage
[PBS] making-stuff: Downloading JSON metadata
ERROR: Unable to download JSON metadata: HTTP Error 404: NOT FOUND (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 329, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1872, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 469, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 656, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
```
Repository: go
Issue: x/crypto/ssh: TerminalModes have no impact on Session.RequestPty
Labels: NeedsInvestigation

``` golang
modes := ssh.TerminalModes{
    ssh.ECHO: 0,
    ssh.ECHOCTL: 0,
    ssh.TTY_OP_ISPEED: 14400,
    ssh.TTY_IP_SPEED: 14400,
}
session.RequestPty("xterm", 80, 40, modes)
```

Control characters are still echoed and tab does not appear to trigger autocompletion in bash.
Repository: go
Issue: tour: rot13Reader hint
Labels: NeedsInvestigation

Context: http://tour.golang.org/methods/12

Great tutorial!
If I may humbly suggest, it would have helped me to be told that all characters in a reader should be processed even if there is an error. I put a guard statement to not bother to do the rot13 if the enclosed reader returned an error, for efficiency reasons. Although obvious after the fact, I didn't discover the source of my problem until I read the docs on Reader.
Repository: go
Issue: go/types: request for NewSelection constructor
Labels: NeedsInvestigation

Consider (*ssa.Program).MethodValue(sel *types.Selection) *ssa.Function. It requires a *types.Selection as its argument. If you have the receiver type T and the selector name (pkg, name), you can obtain a Selection by calling types.NewMethodSet(T).Lookup(pkg, name), but this is asymptotically more expensive than calling types.LookupFieldOrMethod(T, false, pkg, name).

Ideally the client would be able to call LookupFieldOrMethod and then construct a Selection (field or method) from the result, but there is no way for clients to construct a Selection.

Could we expose a NewSelection constructor?

(see #10091 for background)
Repository: neovim
Issue: restore :shell command
Labels: compatibility

Now with the `:terminal` merged I think it makes sense to readd the `:shell` command which will basically do the following:
1. Open new tab.
2. Save `&showtabline` and `&laststatus` variables and set them to zero.
3. Run `:terminal`.
4. Add an autocmd which restores options when terminal exits.
5. Add something which make it exit immediately in place of showing “[Program exited, press any key to close]”.

: simple, easy (except that I do not know what to do with 5) and makes NeoVim more compatible.
Repository: youtube-dl
Issue: Possibility of ignoring videos without subtitle files
Labels: request

Hey there youtube-dl devs!  I am doing some mass information farming to hopefully generate an accurate acoustic model using audio and subtitle information gathered from youtube (or otherwise).  I've found your application to do almost exactly as I need it to and am thoroughly pleased with the results!  Now, my questions to you are as follows:  Is there any to tell youtube-dl to ignore videos that do not have an accompanying subtitle file?  If not, is there any way that youtube-dl will have this functionality in the near future?  I've looked through the man-pages and couldn't find anything so I figure I'd ask you guys!  So, yeah, no bugs, issues or otherwise, just a question.  I appreciate any and all responses! 
Cheers,
Jay.
Repository: go
Issue: tour: introduce collapsible hint sections on page
Labels: NeedsInvestigation

Some recent CLs to the tour added hints to certain problems
where the user used to have to think for themselves.

I suggest that we add collapsible hint sections to hide these
spoiler contents by default.
Repository: rust
Issue: #[repr(C)] enum bit width determination algo does not match that of the C compiler
Labels: A-repr

In C, support for enum determinants that cannot be represented by an `int` is implementation-defined. Many compilers choose a different basic type for representation, based on the types or the values of the determinants. This is where the algorithm currently used by Rust for `#[repr(C)]` enums may differ from the one used by the C compiler, although the difference can be observed in fairly marginal cases.

GCC uses the types of the determinant expressions to find the best fit, so this is a 32-bit type on 64-bit Linux:

``` c
typedef enum {
    A = 0x80000001,
    B = -0x80000000,
} C;
```

Yet this is 64-bit:

``` c
typedef enum {
    A = 0x80000001,
    B = -2147483648  /* -0x80000000 */
} C;
```

This is because the type of [integer constant](http://en.cppreference.com/w/c/language/integer_constant) `0x80000000` is determined as `unsigned int` due to its hexadecimal notation, and the negation preserves the type.

Rust first coerces all discriminants to `isize` and then apparently works out the best fitting representation type from the value range, where fitting means that negative values are preserved as such. So this ends up being 64-bit:

``` rust
#[repr(C)]
enum C {
    A = 0x80000001,
    B = -0x80000000,
}

fn main() {
    println!("{}", std::mem::size_of::<C>());
}
```

I'm uncertain as to which approach is the best for fixing this. Trying to match the behavior of C compilers quirk-for-quirk does not seem to be feasible: there may be more than one compiler per target, and in fact the behavior even changes with compiler options, as e.g. the type of an integer constant is determined differently pre-C99 and post-C99. Perhaps a more conservative solution would be to lint on discriminant values that are out of the `libc::c_int` domain and suggest using fixed-width representations such as `#[repr(u32)]`.
Repository: thefuck
Issue: Strange suggestions for `cd ,,`
Labels: help wanted

I often type `cd ,,` when I meant to type `cd ..`. thefuck suggest the following things for that command.
- `mkdir -p ,, && cd ,,`
- `mkdir -p ,, && cd ,,` (yes, the same twice)
- `cd .`

It would be great to get rid of the duplicate and to add `cd ..` as well
Repository: TypeScript
Issue: Performance of getSemanticDiagnostics in compiler API
Labels: Suggestion,Help Wanted,API

The setup is somewhat similar to the one in the compiler API example (https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services)

The problem, as in the example, is that errors are reported only for files that were directly changed. It doesn't cover the case in which the changed file was a dependency of another file, and even though the file depending on it was not changed, it will still have errors, which won't be reported.

To be more specific, the setup I am talking about is ts-loader + webpack.

What happens is that `getSemanticDiagnostics(file)` has to be called for every file in the project, which ends up increasing the incremental build times considerably. Even `program.getSemanticDiagnostics()` iterates through all of the source files as it is seen in the typescript source code.

I can only see this problem fixed from the compiler API. It could expose a method which finds all files dependent on a given file. Because in an incremental build only a single file changed, this should be faster than calling `getSemanticDiagnostics()` for each and every project file.

The alternative would be some sort of caching on `getSemanticDiagnostics()` itself, but the compiler would probably have to do internally the same work as above to invalidate the cache on file change. This seems to be equivalent to a `getSemanticDiagnosticsForFileAndDependents(file)`-like function.
Repository: go
Issue: cmd/link: Incorrect DWARF scope representation
Labels: help wanted,NeedsFix,Debugging,compiler/runtime

The DWARF information emitted does not correctly represent the scoping of variables within a procedure.

To illustrate, given the following Go source code:

``` go
package main                                                                                                         

import "fmt"

func main() {
        mystr := "foo"
        {
                mystr := "bar"
                fmt.Println(mystr)
        }
        fmt.Println(mystr)
}
```

The relevant information produced in .debug_info is as follows:

```
 <1><58>: Abbrev Number: 2 (DW_TAG_subprogram)
    <59>   DW_AT_name        : main.main
    <63>   DW_AT_low_pc      : 0x401000
    <6b>   DW_AT_high_pc     : 0x401240
    <73>   DW_AT_external    : 1   
 <2><74>: Abbrev Number: 4 (DW_TAG_variable)
    <75>   DW_AT_name        : mystr                                                                                 
    <7b>   DW_AT_location    : 5 byte block: 9c 11 80 7f 22 >   (DW_OP_call_frame_cfa; DW_OP_consts: -128; DW_OP_plus)
    <81>   DW_AT_type        : <0x34e72>
 <2><89>: Abbrev Number: 4 (DW_TAG_variable)
    <8a>   DW_AT_name        : mystr 
    <90>   DW_AT_location    : 5 byte block: 9c 11 90 7f 22 >   (DW_OP_call_frame_cfa; DW_OP_consts: -112; DW_OP_plus)
    <96>   DW_AT_type        : <0x34e72>
```

As you can see, both variables are represented at depth <2> in the tree, however, one should be at depth <3>, following a depth <2> entry of a `DW_AT_lexical_block` with low/high pc values.

The first solution is to produce a tree that properly reflects the lexical blocks in the source code. Secondly, it would be great for `DW_TAG_variable`, `DW_TAG_formal_parameter` and family to include `DW_AT_decl_file` and `DW_AT_decl_line` attributes within the entries.
Repository: rust
Issue: Have rustdoc create hyperlinks on items in compiled code examples
Labels: T-rustdoc,E-hard,C-feature-request

Currently we just generate HTML for the code examples by compiling markdown.

However, rustdoc could compile these examples with a plugin that emits resolved path information for each `ExprPath` and import being used. This part isn't too hard. Might actually be useful as a plugin to be run on independent rust programs.

Then, we need to tweak the syntax highlighting bits so that these paths (those with a known span, that is), get linked appropriately.

cc @alexcrichton @steveklabnik
Repository: rust
Issue: Error when casting a function is not informative
Labels: A-diagnostics,T-compiler,C-bug

``` rust
fn heap_size(_: &usize) -> usize {
    0
}

const f: *const fn(*const usize) -> usize = (&heap_size as *const fn(&usize) -> usize) as *const fn(*const usize) -> usize;

fn main() {
}
```

yields

```
<anon>:5:46: 5:86 error: casting `&fn(&usize) -> usize {heap_size}` as `*const fn(&usize) -> usize` is invalid
<anon>:5 const f: *const fn(*const usize) -> usize = (&heap_size as *const fn(&usize) -> usize) as *const fn(*const usize) -> usize;
                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
```

This error tells me nothing about why it's invalid, and there's no extended explanation.