sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Conditional type which checks nested intersect types evaluates inconsistently when outer type is also intersected and inner type intersects with any.
Labels: Needs Investigation,Fix Available,Rescheduled

# Bug Report

### 🔎 Search Terms

* Conditional type
* union 
* intersect
* nested 

### 🕗 Version & Regression Information

Confirmed that this issue appears in TypeScript versions 3.7, 4.1, 4.2

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/dev/bug-workbench/?ts=4.1.3#code/C4TwDgpgBAkgzgOQPbAIJQLxQN5QJZyoBcUAZgIYA2c0AvgNwBQokshUHmO+hJwATgFc6TFtHScOWeMjRQAPm1RNm4aDJQAhSZKy4CmkhWojVreNp069PQ1AHCoDM9EtXrbWdsUWVYqADCSAB2wOR4wRD8ADzkUBAAHsAQwQAmcFCoADRQAEbxSSnpUJoAfFzYjJIC4cBwJHEAZHlMtFDN2M6MqRAAxpTk-NC9IXDAJUGh4ZH8JJNhEVHR8NlsZYwu9gCMXGJIpBMhCzMA2gDkNXh1ZwC6BclpGRbunAD89kLQUEZUNKJq9gATLs1PtDlNFvx7kUMvNpktyMEQDkLOU3h9HN8yL8IP9WMAAMwgyBgzRwyHnS7XO6JB7FDTANySd7GGhYhy4zbAAAsxIgpPJM2hj0CR3hMURyM8WnKLJx7M+9CAA)

### 💻 Code

```ts
type IsNotA = { isA: false };
type IsA    = { isA: true };
type A      = IsNotA | IsA;

type IsNotB        = { isB: false };
type IsB           = { isB: true };
type B             = IsNotB | IsB;

type Container<a extends A, b extends B> = {
    traits: a & b;
};

declare const BContainer: Container<IsA, IsB>

type t1 = typeof BContainer['traits'] extends IsB          ? true  : false;
type t2 = typeof BContainer extends Container<any, IsB>    ? true  : false;
type t3 = typeof BContainer['traits'] extends IsNotB       ? false : true;
type t4 = typeof BContainer extends Container<any, IsNotB> ? false : true;
```

Notice that the types `t1`, `t2`, `t3`, `t4` all evaluate to true. Right away it should raise alarms that `t4` is evaluated to `true` because I thought that whenever we intersect a concrete type with `any`, it is still considered `any` by the TS compiler even if that behavior itself is an odd choice. Now things get stranger if we change the definition of `Container` to 

```ts
type Container<a extends A, b extends B> = {
    traits: a & b;
} & {};
```

Notice that I intersected on a `{}` type at the end.

### 🙁 Actual behavior

`t4` now evaluates to `false`. This definitely has something to do with the `traits` being a intersect type and the `Container` taking an `any` as type parameter, because if we replace the `any` with `IsA` or `A` when instantiating the `Container` in the extends clause then all evaluate to true again regardless of whether `Container` has an intersection with `{}` or not.

### 🙂 Expected behavior

Intersecting an empty object type `{}` with `Container` should not have changed the evaluation of the conditional type.
`t4` should either evaluate to `true` or `false` in both scenarios. Probably `false` since it seems a concrete type intersected with `any` is still `any`. If TS worked as I would ideally have it then `type thing = 0 & any` would evaluate to `0` in which case `t4` should be `true` in both cases actually, but TS says `type thing = 0 & any` is equivalent to `any` so `t4` should always be `false`.
Repository: pytorch
Issue: build from source fail in jeston tx2 Python3.8
Labels: module: build,triaged,module: arm

-- Found Numa: /usr/include
-- Found Numa  (include: /usr/include, library: /usr/lib/aarch64-linux-gnu/libnuma.so)
-- Using third party subdirectory Eigen.
-- Found PythonInterp: /usr/bin/python3.8 (found suitable version "3.8.7", minimum required is "3.0")
-- Found PythonLibs: /usr/lib/libpython3.8.so.1.0 (Required is at least version "3.0")
CMake Error at cmake/Dependencies.cmake:926 (if):
  if given arguments:

    "VERSION_LESS" "3"

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:513 (include)


-- Configuring incomplete, errors occurred!
See also "/home/yopoint/download/pytorch/build/CMakeFiles/CMakeOutput.log".
See also "/home/yopoint/download/pytorch/build/CMakeFiles/CMakeError.log".

cc @malfet @seemethere @walterddr
Repository: electron
Issue: [Feature Request]:  support --custom-devtools-frontend
Labels: enhancement :sparkles:

**Preflight Checklist**

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.


**Problem Description**

chromiun has support --custom-devtools-frontend flag for specific devtool frontend html app to show devtool. This is useful for some use case such as using electron to develop IDE
https://codereview.chromium.org/2458033003/ 

**Proposed Solution**

Support the --custom-devtools-frontend flag in app.commandLine.appendSwitch

**Alternatives Considered**

nope

**Additional Information**

_No response_
Repository: storybook
Issue: How to customise Doc's parser/generation to treat some comments in a specific way?
Labels: feature request,addon: docs,block: description

I have a component with the following JSDoc:

```js
/**
 * Displays stuff.
 *
 * XXX Be careful about "X".
 */
```

I'd like to generate something along the lines of:

```md
Displays stuff.

<span className="tip">XXX</span> Be careful about "X".
```

How can I do that? Haven't found anything related to this in the doc.

I'd basically like to map some stuff to replace it. Such as:
- `XXX`: Display a "tip"
- `TODO`: Display a "tip"
- `FIXME`: Display a "tip"
- `@see https://xxx.xx`: Display a link to the url
- `@deprecated`: Display a "tip"
- etc.
Repository: flutter
Issue: [animations] OpenContainer should have a onOpen callback that is executed only once
Labels: package,c: proposal,p: animations,team-ecosystem,P3,triaged-ecosystem

I'm using openContainer in my app. I want call a function on OpenContainer's openBuilder page opened. 

My Code Like this but the function runs 2-3 times onOpen and onClose. I want call only 1 time after page opened:

```dart
openBuilder: (BuildContext c,
                                                VoidCallback action) {
                                              _supRepo.getProductStore(context,
                                                  _userRepo.activePage['id'],
                                                  campaign: _userRepo
                                                              .campaignObject.values
                                                              .elementAt(
                                                                  campaignCatIndex)[
                                                          'campaigns']
                                                      [campaignIndex]['id']);
                                              return ProductPage(
                                                showAppBar: true,
                                              );
                                            },
```
Repository: create-react-app
Issue: Bug when compressing/processing css with css variable with calc() & clamp()
Labels: stale,needs triage,issue: bug report

### Describe the bug

CRA cannot recognize SASS calc(), clamp()  statements well, thus resulting compiler error.

### Did you try recovering your dependencies?

I use fresh install npx create-react-app with default setting

### Which terms did you search for in User Guide?

sass, scss

### Environment

  System:
    OS: Windows 10 10.0.19041
    CPU: (2) x64 AMD C-70 APU with Radeon(tm) HD Graphics
  Binaries:
    Node: 12.18.4 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 87.0.4280.141
    Edge: Spartan (44.19041.423.0), Chromium (87.0.664.75)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    react: ^17.0.1 => 17.0.1
    react-dom: ^17.0.1 => 17.0.1
    react-scripts: 4.0.1 => 4.0.1
  npmGlobalPackages:
    create-react-app: Not Found

### Steps to reproduce

(Write your steps here:)

1. In the App.js, add code:
`
import Btn from './Btn.js'
`
and add tag:
`
&lt;Btn /&gt;
`
 
2. Create Btn.js , then paste this code:
```
import './Btn.scss';

export default function Btn() {
  return (
    <button className="btn"></button>
  );
}
```

3. Create Btn.scss, then paste this code:
```
.btn {
    --test: calc(
        1
        * clamp(
            1 ,
            ((1 * 1) * 1) ,
            1
        )
    );
}
```

4. npm i sass
5. npm run build

### Expected behavior

the scss files should produces output like this:
```
.btn {
    --test: calc(1 * clamp(1,((1 * 1) * 1), 1));
}
```

### Actual behavior
```
Creating an optimized production build...
Failed to compile.

Lexical error on line 1: Unrecognized text.
  Erroneous area:
1: 1 * clamp( 1 , ((1 * 1) * 1) , 1 )
^...............................^
CompileError: Begins at CSS selector undefined
```

### Reproducible demo

fork my github here:
https://github.com/heyymarco/react-app-err-css-calc-clamp.git

### Fix the problem

It seem the CRA (or react-scrips) having touble when compressing the output css,
Located about in postcss or cssnano dependency.

Is there any configuration for solving this problem? or at least "disable" the css validation check during compression.
I'm sure my css is valid. Compiled with external sass compiler without problem.
In my actual project, i even created a more complex css operations using calc(), clamp().
clamp(0, (condition * condition) * 999, 1) is my favorite function because i need many "IF" condition in my css variables.
Please solve this problem because my projects cannot be continued before this bug has been fixed.
Repository: rust
Issue: Incorrect span used for doctests defined using `#[doc(include)]` or `#[doc = include_str!("...")]`
Labels: T-rustdoc,C-bug,A-doctests

Given these two files:

`ducks.rs`

```rust
#![feature(extended_key_value_attributes)]
#[doc = include_str!("ducks.md")]
fn ducks() {}
```

`ducks.md`

    test
    test
    test
    test
    test
    test
    test
    test
    test
    test

    ```rust
    invalid syntax
    ```

When I run `rustdoc --test ducks.rs`, I get an error:

```
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `syntax`
 --> ducks.rs:14:9
  |
3 | invalid syntax
  |         ^^^^^^ expected one of 8 possible tokens

error: aborting due to previous error
```

The error message is correct. However, the position (`ducks.rs:14:9`) is invalid. I would expect it to reference either the original `include_str!` call, or (preferred) the snippet in the Markdown file.

### Meta

`rustc --version --verbose`:
```
rustc 1.51.0-nightly (bc39d4d9c 2021-01-15)
binary: rustc
commit-hash: bc39d4d9c514e5fdb40a5782e6ca08924f979c35
commit-date: 2021-01-15
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0
```

cc #78835
Repository: storybook
Issue: What's the recommended way to write dynamic stories and yield proper `Story` source code?
Labels: question / support,addon: storysource

There are many examples around about to write Stories, it's hard for newcomers to understand what is the recommended way, especially when we want to use dynamic stories with `args`.

Here is what I'm doing now, I think it's not too bad:

```tsx
import {
  Meta,
  Story,
} from '@storybook/react/types-6-0';
import React from 'react';
import Btn from '../../../components/utils/Btn';
import SpoilerLink, { Props } from '../../../components/utils/SpoilerLink';

export default {
  title: 'Next Right Now/Form/SpoilerLink',
  component: SpoilerLink,
  argTypes: {},
} as Meta;

const Template: Story<Props> = (props) => {
  return (
    <SpoilerLink
      {...props}
    />
  );
};

export const DynamicExample: Story<Props> = Template.bind({});
DynamicExample.args = {
  previewElement: (
    <span>Spoil me!</span>
  ),
  spoilerElement: (
    <span>Arya Stark's phone number is 000000000</span>
  ),
  className: '',
  href: 'tel:000000000',
};

export const DynamicExampleWithBtn: Story<Props> = Template.bind({});
DynamicExampleWithBtn.args = {
  previewElement: (
    <Btn>Spoil me!</Btn>
  ),
  spoilerElement: (
    <Btn mode={'primary-reverse'}>Arya Stark's phone number is 000000000</Btn>
  ),
  className: '',
  href: 'tel:000000000',
};

```

This way is flexible enough for me to add more stories without too much code duplicate.

The problem is the `Story` panel that shows meaningless source code (compared to other ways of writing stories):

![image](https://user-images.githubusercontent.com/3807458/104808910-8678eb00-57e9-11eb-914e-89a68d0855ad.png)

Demo: https://nrn-v2-mst-aptd-at-lcz-sty-storybook.vercel.app/?path=/story/next-right-now-form-spoilerlink--dynamic-example-with-btn

All stories will show the same source code, and it makes the whole "Story" panel unusable.

---

Is this a known issue? Is there a workaround?
I tried to think about it, and the goal of the "Story" panel is to show code that can be copied for quick use. Displaying either the above source code, or the whole story file (*.stories.tsx) would be unusable. It'd need to show a code example that infers the `args`, such as:

```tsx
(props) => {
  return (
    <SpoilerLink
      previewElement={(
	      <span>Spoil me!</span>
	    )}
      spoilerElement={(
	      <span>Arya Stark's phone number is 000000000</span>
	    )}
      className={''}
      href={'tel:000000000'}
    />
  );
}
```

Something like this would give a much better developer experience.
Repository: bitcoin
Issue: Handling of duplicate keys in JSON
Labels: RPC/REST/ZMQ

Our handling of duplicate keys in JSON dictionaries is different from that of other languages like Python, Javascript (and most others I know of).

While those languages parse the JSON and build hash tables, the last assignment of a key is what takes effect. e.g.
```python
>>> json.loads('{"a": "first", "a": "second"}')
{'a': 'second'}
```

Our  `univalue`, though, stores every (key,value) pair in an array, and when a key is queried it returns the *first* associated value.

```c++
#include <iostream>
#include <univalue.h>

int main() {
    UniValue val;
    val.read("{\"a\": \"first\", \"a\": \"second\"}");
    std::cout << val["a"].write() << std::endl;
    return 0;
}
```

```bash
$ g++ unitest.cpp -o unitest -Iunivalue/include -L src/univalue/.libs -lunivalue
$ ./unitest 
"first"
```

This is not generally a problem but can create subtle interoperability issues. For example a proxy that validates the allowed JSON-RPC commands and lets through only some combinations of command/argument (and doesn't take this into account) could be misled in this way.

Either reversing this order or adding a "strict mode" that rejects duplicate keys might make sense. I don't know.

(issue originally reported by Florian Mathieu)
Repository: rust
Issue: Tracking Issue for {BTreeMap,BTreeSet}::drain
Labels: C-tracking-issue

This is a tracking issue for a range-based `drain` method on `BTreeMap` and `BTreeSet`, similar to the one in `Vec`.
The feature gate for the issue is `#![feature(btree_drain)]`.

### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

### Steps
- [ ] Implement the main method
- [ ] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide])
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs

### Unresolved Questions
- Is plain `drain` the right name for a range-based function? It's equivalent to `Vec::drain` if you consider a `Vec<T>` to be a `BTreeMap<usize, T>` with consecutive keys. It's not equivalent to the `HashMap::drain()` without argument, and `BTreeMap::drain(..)` doesn't compile without a type annotation [if the key type has additional `Borrow` implementations](https://users.rust-lang.org/t/is-btreemap-range-incompletely-defined/54107), whereas `Vec::drain(..)` is always a simple way to drain everything.
- An efficient implementation of draining implies most of the drained key-value pairs are in entirely preserved (and not even visited) subtrees. Therefore, the return value can be relatively easily adapted to obtain a range-based method much like `split_off`. Is it OK to add `split_off_range` along the way?

### Implementation history
- First real shot: #81075
- Early attempt at argumentless `drain`: #66747
Repository: youtube-dl
Issue: [YouTube] YT Music: Extract Lyrics as Metadata or Subtitles
Labels: 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 2021.01.16. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Search the bugtracker for similar feature 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 feature request
- [x] I've verified that I'm running youtube-dl version **2021.01.16**
- [x] I've searched the bugtracker for similar feature requests including closed ones


## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
-->

Hi guys,

since a few months Youtube Music supports showing lyrics for autogenerated music "videos". 
My feature request concerns extracting those, either as video metadata or subtitles.

Example URL: https://music.youtube.com/watch?v=iZ_SwfLlpHo
Tab on the upper right "Lyrics"

Thanks for the great tool and your efforts!
Repository: material-ui
Issue: [core] Decide if a value belongs in props or context
Labels: breaking change,component: text field

I think the actual code smell is computing some variable from context and props. Just like a component instance should either read from state or props (but not switch between) we shouldn't listen to context and props. It's a general issue with our form components where `<FormControl disabled><Input disabled={false} /></FormControl>` is allowed for some reason. The `disabled` state should live at a single point.

In v5 we should revisit this and decide if something lives in props or context.

_Originally posted by @eps1lon in https://github.com/mui-org/material-ui/issues/19319#issuecomment-576449998_

Related:
- [TextField with focused and disabled causes an infinite render](https://github.com/mui-org/material-ui/issues/24777)
Repository: rust
Issue: asm! should automatically rewrite labels in assembly code
Labels: C-enhancement,A-inline-assembly,F-asm

Defining labels in inline assembly is broken because inlining, function cloning and other compiler optimizations may result in an `asm!` block being emitted more than once in the final binary. This can cause duplicate symbol errors or even compiler crashes (#74262). For this reason it is recommended to only use GAS local labels when using `asm!` (#76704).

To improve user experience when using `asm!`, rustc should automatically rewrite label names into a unique name. For example:
```rust

asm!(
    "popcnt {popcnt}, {v}",
    "loop:",
    "blsi rax, {v}",
    "jz exit",
    "xor {v}, rax",
    "tzcnt rax, rax",
    "stosb",
    "jmp loop",
    "exit:",
    v = inout(reg) value => _,
    popcnt = out(reg) popcnt,
    out("rax") _, // scratch
    inout("rdi") bits.as_mut_ptr() => _,
);
```

rustc should search for lines beginning with `<ident>:` to find label names and then replace all instances of `<ident>` in the assembly code with `.Lasm_label_<ident><unique id>`. The `.L` instructs the assembler that the label is local to the current compilation unit and should never be exported, even as a debug symbol. The unique ID can be generated by LLVM using `${:uid}` and is guaranteed to be unique within the current compilation unit.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"asquared31415"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: rust
Issue: Move reporting recursion limit errors outside of the trait system
Labels: C-cleanup,A-trait-system,T-compiler,fixed-by-next-solver

This is the proper fix for the breakage in https://github.com/rust-lang/rust/issues/79506 and https://github.com/rust-lang/rust/issues/79459.

The steps are basically to find all of the places that create a `OverflowError` or `SelectionError::Overflow` and make sure that they are always early returned until outside of `rustc_trait_selection::traits::{select, project}`, at which point they should be emitted. Overflow errors should never be converted to any other kind of error (such as `EvaluatedToRecur` or `EvaluatedToError`)

_Originally posted by @matthewjasper in https://github.com/rust-lang/rust/pull/81055#issuecomment-761607120_
Repository: excalidraw
Issue: Improve error message dialogs
Labels: enhancement,UX/UI

Not sure what to do.. but this is a bit _ugly_ :)

<img width="576" alt="Screenshot 2021-01-16 at 8 53 30 PM" src="https://user-images.githubusercontent.com/125676/104820354-e64cb180-583c-11eb-9366-e9cef5b0f182.png">

This is better, but could still use some facelift

<img width="568" alt="Screenshot 2021-01-16 at 8 54 43 PM" src="https://user-images.githubusercontent.com/125676/104820411-2449d580-583d-11eb-8a36-31db18b4efd4.png">