id
int64
393k
2.82B
repo
stringclasses
68 values
title
stringlengths
1
936
body
stringlengths
0
256k
labels
stringlengths
2
508
priority
stringclasses
3 values
severity
stringclasses
3 values
321,649,026
go
doc: eliminate commit-message skew between Contribution Guide and wiki
After @rasky's updates, https://tip.golang.org/doc/contribute.html#commit_messages has a nice, clear guide to Go commit messages. https://github.com/golang/go/wiki/CommitMessage has a very similar guide. Unfortunately, they have a bit of skew: for example, the wiki mentions a 76-column limit, whereas `contribute.html` does not. We should eliminate that skew: either both documents should list the full details, or one should provide a more concise summary and link to the other for details.
Documentation,help wanted,NeedsInvestigation
low
Major
321,716,280
go
cmd/compile: call memmove on amd64 for large OpMove
Currently we lower OpMove with large size into REP MOV. Memmove has optional AVX&co codepath, so it should be faster than REP MOV, or at least as fast if REP MOV is optimal (call overhead is insignificant for large sizes). We should probably generate a call to memmove for really big OpMove.
Performance,NeedsInvestigation,compiler/runtime
low
Minor
321,733,729
TypeScript
"program.emit" produces wrong declaration file if "declaration" option is false or not specified
**TypeScript Version:** 2.9.0-dev.20180506 <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** declaration, emitting. **Code** ```ts declare module ModuleName {} declare var ModuleName: { prototype: any }; export { ModuleName }; ``` Steps to reproduce: 1. Create `index.ts` with content above 1. Open `node` in folder with this file and installed `typescript` and type the following: ```js var ts = require('typescript'); var program = ts.createProgram(['index.ts'], {}); var res = program.emit(undefined, undefined, undefined, true); ``` **Expected behavior:** Possible that calling `program.emit` with `emitOnlyDtsFiles = true` and without specifying `declaration: true` in the config should produce an error, but I am not sure that it is good solution. **Actual behavior:** The compiler produces `index.d.ts` file with only one line `export { ModuleName };` which is incorrect definitions (`res` is object with the following state: `{ emitSkipped: false, diagnostics: [], emittedFiles: undefined, sourceMaps: undefined }`). For `2.8.3` version it produces ```ts declare module ModuleName { } declare var ; export { ModuleName }; ``` which is broken declaration too. If run from cmd `./node_modules/.bin/tsc --emitDeclarationOnly` it fails with `error TS5052: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration'`.
Bug,Help Wanted,API
low
Critical
321,757,181
go
net: DNS address resolution quirks (AAAA records inconsistency)
This bug reports is about an inconsistency on how resolution is handled between the Go resolver and the CGO one. I do not expect a bugfix (although probably beneficial, but I leave that estimation to others) but at least an understanding of why the Go resolver behaves this way. ### What version of Go are you using (`go version`)? ``` go version go1.10.1 linux/amd64 ``` ### Does this issue reproduce with the latest release? Latest release is 1.10.2 at the time of writing; not tested, by reading the release notes, nothing should have changed on the relevant code. ### What operating system and processor architecture are you using (`go env`)? ``` GOARCH="amd64" GOBIN="" GOCACHE="[...]" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="[...]" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build482647299=/tmp/go-build -gno-record-gcc-switches" ``` ### Test setup issue25321.go can be obtained from https://play.golang.org/p/kE_Unq4VvkO IPv6 is disabled on this box; the DNS server may or may not return `AAAA` records (I have a toggle for that). When AAAA answers are allowed: ``` $ nslookup -query=AAAA www.googleapis.com Server: 127.0.0.1 Address: 127.0.0.1#53 Non-authoritative answer: www.googleapis.com canonical name = googleapis.l.google.com. googleapis.l.google.com has AAAA address 2a00:1450:4001:825::200a Authoritative answers can be found from: ``` When they are not allowed: ``` $ nslookup -query=AAAA www.googleapis.com Server: 127.0.0.1 Address: 127.0.0.1#53 *** Can't find www.googleapis.com: No answer ``` But in both cases, an A query works: ``` $ nslookup -query=A www.googleapis.com ;; Warning: Message parser reports malformed message packet. ;; Truncated, retrying in TCP mode. Server: 127.0.0.1 Address: 127.0.0.1#53 Non-authoritative answer: www.googleapis.com canonical name = googleapis.l.google.com. Name: googleapis.l.google.com Address: 216.58.207.74 [... amended ...] ``` ### Test results Reminder: IPv6 is always disabled, only the netdns resolver and the responses of the DNS are varying for the below tests. | Command | DNS returns AAAA | DNS does not return AAAA | | ------------- |-------------| -----| | `go run issue25321.go` | :finnadie: `2018/05/10 00:52:01 dial failed www.googleapis.com Get http://[2a00:1450:4001:821::200a]:80/: dial tcp [2a00:1450:4001:821::200a]:80: connect: cannot assign requested address`<br>`2018/05/10 00:52:11 HTTP failed www.googleapis.com Get http://www.googleapis.com/: dial tcp [2a00:1450:4001:821::200a]:80: connect: cannot assign requested address` | :finnadie: `2018/05/10 00:43:23 dial failed www.googleapis.com lookup www.googleapis.com on 127.0.0.1:53: read udp 127.0.0.1:59700->127.0.0.1:53: i/o timeout`<br>`2018/05/10 00:43:33 HTTP failed www.googleapis.com Get http://www.googleapis.com/: dial tcp: lookup www.googleapis.com on 127.0.0.1:53: read udp 127.0.0.1:43538->127.0.0.1:53: i/o timeout` | | `GODEBUG=netdns=cgo go run issue25321.go` | :feelsgood: `2018/05/10 00:47:23 dial failed www.googleapis.com Get http://[2a00:1450:4001:81d::200a]:80/: dial tcp [2a00:1450:4001:81d::200a]:80: connect: cannot assign requested address`<br>`2018/05/10 00:47:23 OK www.googleapis.com 192.168.1.12:57248 -> 216.58.207.74:80` | :suspect: `2018/05/10 00:43:07 OK www.googleapis.com 192.168.1.12:57156 -> 216.58.207.74:80` | Forgive the horrible representation, but there are two log lines at most in those table cells, you can see them better by copy/pasting their content. Worthy of note: in the case of CGO resolver and AAAA answers allowed, first there is a failure (dialer) and then a success (HTTP request). Another note: resolving `www.bing.com` is not affected by this problem, so problem must be related to how the records are returned from the DNS. ### Expected results The expected result for all the 4 combinations would be (since IPv6 is disabled on this box): do not try `AAAA` and use an `A` record, like on the bottom-right cell of the tests matrix. ### Questions arising from this test 1. how is the order of answers handled? is there a preference to `AAAA` records somehow? (I am inclined to think so) 2. how could ever the resolution timeout when no `AAAA` is returned? this would be somehow the most serious part of the bug (if acknowledged), although it should first be determined if it is not a problem of the DNS (server-side) ### Related * #8453 * https://github.com/ncw/rclone/issues/2302
NeedsInvestigation
low
Critical
321,784,058
vscode
[Emmet] Include should be more like DocumentSelector
Currently, the Emmet extension has a setting called `emmet.includeLanguages` which just targets language IDs to map to the Emmet-capable language ID. I think it would be very useful if instead you could use something more like `DocumentSelector`, which also allows [`DocumentFilter`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#DocumentFilter) instead of just language ID.
help wanted,feature-request,emmet
low
Major
321,789,398
storybook
Show more source files in storysource
Hello, I'm interested in getting the version of this demo https://building.coursera.org/coursera-ui/?selectedKind=Welcome&selectedStory=to%20Storybook&full=0&addons=0&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel to render, test and play out locally. Can you help with where to clone/download it? The only one I found was outdated. thanks
feature request,addon: storysource
medium
Critical
321,805,056
go
crypto/rand: add package example
The crypto/rand package has no package example; even just copying the Read example up to the package level would be helpful. The crypto/rand package also doesn't have the same convenience helpers that math/rand has, so it might be helpful to see e.g. how to implement Intn using the crypto/rand package.
Documentation,help wanted,NeedsFix
low
Major
321,850,822
pytorch
[feature request] torch.nn.DataParallel should work nicely both for cpu and gpu devices
If the working machine has a GPU card, it seems that there is no way for torch.nn.DataParallel to work on the CPU. This is due to the following lines in the torch.nn.DataParallel. ``` if not torch.cuda.is_available(): self.module = module self.device_ids = [] return ``` Thus, we should provide an option that if device_ids = None then torch.nn.DataParallel works on the CPU. if devices_ids = [], then all available GPUs should be used. or implement the to() method for torch.nn.DataParallel. So we can freely run the code on GPU or CPU if torch.nn.DataParallel is used.
triaged,enhancement,module: data parallel
low
Minor
321,862,190
flutter
Encourage reproducible builds
I've been thinking about how this could be tackled for a while, but what triggered me to open this issue was a question by a fellow flutter dev. "Is there any way to see which flutter version someone is using from their github repo?" - @iampawan Although I consider good practice writing `pubspec.yaml` with specific versions (no ^ or ranges) and explicit flutter version `environment: \n flutter: 0.x.x` , these rarely happen. I noticed `pubspec.lock` doesn't contain a number to the flutter version used as well: ``` flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" ```
c: new feature,framework,P2,team-framework,triaged-framework
low
Major
321,981,819
TypeScript
Improve references for import type of JS modules
See `findAllRefs_importType_js.ts` (added in #23998)
Bug
low
Minor
321,991,178
pytorch
Make c10d/FileStore cache file descriptor
Per comment from @apaszke in #7439, there is no need to reopen the underlying file for every operation. Instead we can keep the file open and only acquire/release the shared/exclusive lock.
newcomer,oncall: distributed,feature,triaged
low
Minor
322,000,814
kubernetes
CRDs: support binary encoding
/kind feature I think eventually we will be asked to add a proto encoding for CRDs. It's very non-obvious how to do this, so I think we should start talking about it now. I can think of two approaches off the top of my head: 1. Require the user to supply a proto spec as part of the CRD object. 2. Add x-proto-field-number extensions to OpenAPI spec documents. Require the user to set them in the CRD's `validation` field (which we should really rename, but that's another issue). (We'd also have to add type information, or define a strict mapping between the types we express in the spec and proto types.) 1 has the benefit of being very obvious, and probably less work. But I think I prefer 2, because it lets us expose the proto format for built-in types in exactly the same way.
area/extensibility,sig/api-machinery,kind/feature,priority/important-longterm,area/custom-resources,lifecycle/frozen
medium
Major
322,013,113
go
net/http: document when url.Error type is returned
Document when url.Error type is returned. (which Client methods)
Documentation,NeedsFix
low
Critical
322,014,163
terminal
Copying with Ctrl-Shift-C copies literal buffer, not lines
Selecting text and copying with Ctrl-Shift-C copies the buffer literally, which gives a line full of spaces and no newline. Copying with right click works as intended. Verified in cmd.exe, pwsh.exe and zsh. * Your Windows build number: (Type `ver` at a Windows Command Prompt) 17666 * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) ``` PS> echo "foo`nbar" foo bar PS> # copy those two lines with Ctrl-Shift-C and paste into notepad PS> # should have a line full of spaces before "bar" ``` * What's wrong / what should be happening instead: It should do the same thing as right click copy - lines have a new line at the end instead of being filled with spaces.
Work-Item,Product-Conhost,Area-Interaction,Issue-Task
low
Major
322,029,811
go
x/build/cmd/gerritbot: does not respect codereview.cfg for fixing commit messages
https://go-review.googlesource.com/112277, which came from PR golang/vgo#4, said "Fixes #24099." The git-codereview tool would have read the vgo repo's codereview.cfg and automatically rewritten that line to say "Fixes golang/go#24099." This helps both authors and reviewers, neither of whom have to think about this anymore. The PR-bot should do the same, because as a reviewer I certainly don't want to lapse back into being in charge of catching this trivial but common mistake. Because the bot did not fix the commit message, the eventual submit did not close the issue.
help wanted,Builders,NeedsFix
low
Minor
322,034,978
rust
Incorrect padding on hexadecimal formatting of integers
The behavior in https://github.com/rust-lang/rust/pull/48978 does not seem correct. [Playground link](https://play.rust-lang.org/?gist=ccadba488e9120ff29235cbdfdca799b&version=beta&mode=debug) The number of digits in the output doesn't seem to match the requested amount of padding.
C-enhancement,T-libs-api
low
Critical
322,048,207
go
cmd/go: go test -list does things other than listing tests
This is a small quibble, but caused me some surprise recently. ### What version of Go are you using (`go version`)? go version go1.10.2 linux/amd64 ### Does this issue reproduce with the latest release? Yes ### What operating system and processor architecture are you using (`go env`)? ``` GOARCH="amd64" GOBIN="" GOCACHE="/home/eric/.cache/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/eric/go" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build753721336=/tmp/go-build -gno-record-gcc-switches" ``` ### What did you do? foo_test.go ``` package foo import ( "fmt" "testing" ) func init() { fmt.Println("Hello, world!") } func TestFoo(t *testing.T) {} ``` ``` $ go test -list=TestFoo ``` ### What did you expect to see? ``` TestFoo ``` ### What did you see instead? ``` Hello, world! TestFoo ok github.com/echlebek/foo 0.001s ``` In https://github.com/golang/go/issues/17209, Nemith proposes that `go test -list` would list the tests, but no tests would be run or any other operation. I think that since it can be statically determined what the tests in a package are, the -list functionality should not depend on executing the test binary.
NeedsInvestigation
low
Critical
322,049,245
go
x/text/language: Cannot parse ISO/IEC 15897 (C, POSIX, etc.) as language tags
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? ```console ~/.local/lib/go/src/golang.org/x/text $ go version go version go1.10.2 linux/arm64 ~/.local/lib/go/src/golang.org/x/text $ git describe v0.3.0-48-g67e48ad ``` ### Does this issue reproduce with the latest release? Yes. ### What operating system and processor architecture are you using (`go env`)? ```console $ go env GOARCH arm64 ``` ### What did you do? ```console $ cat main.go package main import ( "fmt" "golang.org/x/text/language" ) func main() { tag, err := language.Parse("POSIX") fmt.Printf("%v\n%v\n", tag, err) } $ go run main.go und language: tag is not well-formed ``` ### What did you expect to see? A POSIX language tag. ### What did you see instead? A "tag is not well-formed" error. Passing `C` instead of `POSIX` produces the same error. Neither of these subtags are in [the IANA registry][1], so the current errors are strictly compliant with [the current BCP 47 claim][2]. But [POSIX defines a collation order][3] which the current behavior does not provide access to. As far as I can tell, there's currently no way to [create a `Collator`][4] that will sort using the POSIX rules. Do folks who need to support them need to roll their own sorter, or should x/text/language be extended to support locales from the [ISO/IEC 15897][5] registry? Is this related to the `posix` variant discussed [here][6], [here][7], and [here][8] (but not [registered][1] or [grandfathered][9]?)? Maybe I should be translating `LC_COLLATE=POSIX` and `LC_COLLATE=C` to a `und-u-va-posix` language tag for sorting? See also the distinction between languages and locales [in RFC 2277][10]. This may be related to [this TODO][11]? [1]: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry [2]: https://github.com/golang/text/blob/7922cc490dd5a7dbaa7fd5d6196b49db59ac042f/language/language.go#L19 [3]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_02_06 [4]: https://godoc.org/golang.org/x/text/collate#New [5]: https://en.wikipedia.org/wiki/ISO/IEC_15897 [6]: https://unicode.org/reports/tr35/#Legacy_Variants [7]: https://unicode.org/cldr/trac/ticket/7958 [8]: https://unicode.org/pipermail/cldr-users/2014-September/000142.html [9]: https://tools.ietf.org/html/rfc5646#section-2.2.8 [10]: https://tools.ietf.org/html/rfc2277#section-4.3 [11]: https://github.com/golang/text/blob/7922cc490dd5a7dbaa7fd5d6196b49db59ac042f/internal/language/compact/gen_index.go#L50
NeedsInvestigation
low
Critical
322,051,337
pytorch
[caffe2] How to use multiple CPUs?
I want to run a caffe2 model on multiple CPUs (evaluation). Is there a way to do that directly? Maybe it requires OpenBLAS? I don't think is it possible to use multiprocessing and call RunNet on different workspaces.
caffe2
low
Minor
322,058,200
go
x/net/ipv4: add IPv4 header checksum computation for ipv4.Header type
I'm working on a project that uses packet sockets directly, and I have to calculate the IPv4 checksum on my own since I'm building from Ethernet frames up. I notice that `x/net/ipv4` doesn't provide any way to easily calculate a checksum, but I think such a function/method could be useful in conjunction with the `ipv4.Header` type. I wrote a basic implementation in ~30 lines with documentation comments, and would be happy to submit it upstream. At this point, my questions are: - Is this something that would be considered generally useful enough to go in `x/net/ipv4`? - If so, what should the API look like? My current implementation accepts a byte slice from the output of `ipv4.Header.Marshal`, but I could see a method making sense as well. ```go // ipv4Checksum computes the IPv4 header checksum for input IPv4 header bytes. func ipv4Checksum(b []byte) (uint16, error) { // ... } ``` /cc @mikioh
Proposal,Proposal-Accepted
medium
Critical
322,112,309
opencv
Mouse Wheel Zoom cannot be disabled?
Hi, I'm using version 3.4.0 for python on Ubuntu. I want to implement custom functionality by listening to mouse-wheel events (wheel up and down). How can I disable the by default activated zoom in the window when using the mouse wheel? Thanks a lot, Kim
feature,priority: low,category: highgui-gui
low
Major
322,122,105
TypeScript
Destructuring parameter JSDoc not matched up correctly
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section! Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ Please fill in the *entire* template below. --> <!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --> **TypeScript Version:** 2.9.0-dev.201xxxxx <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** **Code** ```ts /** * @param {number} options.response * @param {string} options.session * * @return {void} */ function handle({ response, session }) { // fails, { response, session } : { any, any } } /** * @param {Object} options * @param {number} options.response * @param {string} options.session * * @return {void} */ function handle({ response, session }) { // Works { response, session } : { number, string } } ``` **Expected behavior:** 1. params have the right type in side the function 2. `handle` should be of type the type `({ response: string, session: number }) => void`. **Actual behavior:** In both cases, `handle` has the type `(number) => void`. **Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> **Related Issues:** <!-- Did you find other bugs that looked similar? -->
Bug,Domain: JSDoc,Domain: JavaScript
low
Critical
322,148,466
vscode
Setting to ignore whitespace-only lines
VS Code currently removes all trailing whitespace including on whitespace only lines. Consider the following JavaScript/Typescript snippet: ``` export default class Example { constructor() { console.log("called constructor"); } doSomething() { console.log("I did something."); } } ``` When I come back to this file, I expect to be able to move the cursor between the two methods and add a new one in between without having to hit the tab key, but after running the VS Code formatter, the whitespace on that line (ln. 5) is removed. Atom supports this under an "Ignore Whitespace Only Lines" setting. Additionally, there's a VS Code extension which adds this functionality. [Trailing Whitespace VS Code Plugin](https://marketplace.visualstudio.com/items?itemName=shardulm94.trailing-spaces#user-content-include-empty-lines) It'd be really great if it were configurable and/or auto-detected on a per-file basis by the editor, and would really help my workflow. Thanks so much, Andrew
feature-request,editor-core
high
Critical
322,151,474
pytorch
[Caffe2]: caffe2.python.caffe_translator.py script doesn't convert "Split" and "Slice" Layer
## Issue description I ran the caffe_translator.py script to convert my Caffe model to Caffe2. My Caffe model has "Split" and "Slice" Layer. The caffe_translator.py doesn't seem to handle them. I had to hack on my own copy of caffe_translator.py to get it running and then manually edit the pbtxt file. ## Code example Please try to provide a minimal example to repro the bug. Error messages and stack traces are also helpful. Example 1 $ python -m caffe2.python.caffe_translator IDN_x4_deploy.prototxt IDN_x4.caffemodel INFO:caffe_translator:Translate layer conv1 INFO:caffe_translator:Translate layer relu_conv1 INFO:caffe_translator:Translate layer conv2 INFO:caffe_translator:Translate layer relu_conv2 INFO:caffe_translator:Translate layer split1 Traceback (most recent call last): File "/home/jsun/anaconda3/lib/python3.6/site-packages/caffe2/python/caffe_translator.py", line 212, in TranslateLayer caffe_ops, params = cls.registry_[layer.type]( KeyError: 'Split' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/jsun/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/home/jsun/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/jsun/anaconda3/lib/python3.6/site-packages/caffe2/python/caffe_translator.py", line 912, in <module> input_dims=args.input_dims File "/home/jsun/anaconda3/lib/python3.6/site-packages/caffe2/python/caffe_translator.py", line 284, in TranslateModel return TranslatorRegistry.TranslateModel(*args, **kwargs) File "/home/jsun/anaconda3/lib/python3.6/site-packages/caffe2/python/caffe_translator.py", line 273, in TranslateModel net_params=net_params, input_dims=input_dims) File "/home/jsun/anaconda3/lib/python3.6/site-packages/caffe2/python/caffe_translator.py", line 216, in TranslateLayer str(layer)) KeyError: 'No translator registered for layer: name: "split1"\ntype: "Split"\nbottom: "conv2"\ntop: "split1_1"\ntop: "split1_2"\n yet.' Example 2 I get a similar stack-trace for "Slice" operator. Traceback (most recent call last): File "/home/jsun/Code/IDE_caffe_to_caffe2/new/caffe_translator.py", line 212, in TranslateLayer caffe_ops, params = cls.registry_[layer.type]( KeyError: 'Slice' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/jsun/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/home/jsun/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/jsun/Code/IDE_caffe_to_caffe2/new/caffe_translator.py", line 917, in <module> input_dims=args.input_dims File "/home/jsun/Code/IDE_caffe_to_caffe2/new/caffe_translator.py", line 284, in TranslateModel return TranslatorRegistry.TranslateModel(*args, **kwargs) File "/home/jsun/Code/IDE_caffe_to_caffe2/new/caffe_translator.py", line 273, in TranslateModel net_params=net_params, input_dims=input_dims) File "/home/jsun/Code/IDE_caffe_to_caffe2/new/caffe_translator.py", line 216, in TranslateLayer str(layer)) KeyError: 'No translator registered for layer: name: "slice1"\ntype: "Slice"\nbottom: "conv3_3"\ntop: "slice1_1"\ntop: "slice1_2"\nslice_param {\n slice_point: 16\n axis: 1\n}\n yet.' ## System Info Please copy and paste the output from our $ python collect_env.py Collecting environment information... PyTorch version: 0.4.0 Is debug build: No CUDA used to build PyTorch: 9.1.85 OS: Ubuntu 18.04 LTS GCC version: (Ubuntu 6.4.0-17ubuntu1) 6.4.0 20180424 CMake version: version 3.9.4 Python version: 3.6 Is CUDA available: Yes CUDA runtime version: 9.1.85 GPU models and configuration: GPU 0: GeForce GTX 1070 Nvidia driver version: 396.24 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.0.5 /usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a /usr/local/MATLAB/R2018a/bin/glnxa64/libcudnn.so.7.0.3 /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7.0.5 /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn_static.a /usr/local/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb Versions of relevant libraries: [pip3] guided-filter-pytorch (1.1.1) [pip3] numpy (1.14.3) [pip3] numpydoc (0.7.0) [pip3] torch (0.5.0a0+833b1e6) [pip3] torchvision (0.2.1) [conda] cuda90 1.0 h6433d27_0 pytorch [conda] cuda91 1.0 h4c16780_0 pytorch [conda] guided-filter-pytorch 1.1.1 <pip> [conda] magma-cuda90 2.3.0 1 pytorch [conda] pytorch 0.4.0 py36_cuda9.1.85_cudnn7.1.2_1 [cuda91] pytorch [conda] torch 0.5.0a0+833b1e6 <pip> [conda] torchvision 0.2.1 py36_1 pytorch
caffe2
low
Critical
322,159,129
pytorch
[caffe2] How to know the input shape for certain pre-trained network
Sorry, I'm new in Caffe2. I downloaded the some of models from model zoo. The models are just like pkl, init_net.pb & predict_net.pb, etc. Does caffe2 can show the model detail similar with the keras "model.summary"? Because I have to know the input shape for the model.
caffe2
low
Minor
322,160,550
go
x/build/cmd/gopherbot: reply to unversioned urls with permalink
It seems to be a frequent occurrence that non-versioned github urls with line numbers are included in issues. These links make investigations more time consuming when code inevitably changes. The problematic pattern is: `https://github.com/<repo>/blob/master.+#L\d+` Example: https://github.com/golang/go/blob/master/src/mime/multipart/formdata.go#L78 I would guess that a quarter [of these](https://github.com/golang/go/issues?utf8=%E2%9C%93&q=is%3Aissue+blob+master) match that pattern. Let's say there are 3 primary categories of non-versioned code urls with line number(s): 1. non-Go (mostly on github.com) 2. Go on github.com 3. Go on golang.org 3 is very much in our control and is discussed in https://github.com/golang/go/issues/14062. 1 and 2 are harder to control. A solution could be gopherbot replying to new issues that match the pattern with a permalink that included the latest commit when the issue was created. (Another solution is to have the new issue template suggest a versioned url for any non-playground code.) To avoid spam, maybe this would only respond to the body of a new issue - not any comments. The message could be something like: > - https://github.com/golang/go/blob/master/src/run.bash#L21 is currently https://github.com/golang/go/blob/47be3d49c7d7ff77e675b0d0fb78c05fdb43dee2/src/run.bash#L21 > - https://github.com/moby/moby/blob/master/poule.yml#L36 is currently https://github.com/moby/moby/blob/f4ebcb42ac527b24ab54525d5824478fcd2960c0/poule.yml#L36 @andybons @bradfitz
Builders,FeatureRequest
low
Minor
322,174,952
flutter
Text does not conform to DefaultTextStyle which is beyond Scaffold
## Steps to Reproduce `Text` does not conform to `DefaultTextStyle` which is beyond `Scaffold`. I am using `DefaultTextStyle` to set default `Locale` to all text. I would like to set `DefaultTextStyle` at the root of the application instead of setting each `Text`. In the following example, `Text` does not conform to locale. Also, it does not conform color too. Because `Scaffold` uses `DefaultTextStyle` internally and the style is not inherited. ```dart import 'package:flutter/material.dart'; void main() { runApp(new MaterialApp( home: new FooPage(), )); } class FooPage extends StatefulWidget { @override State<StatefulWidget> createState() { return new FooPageState(); } } class FooPageState extends State<FooPage> { String _language = "ja"; String _country = "JP"; @override Widget build(BuildContext context) { return new DefaultTextStyle( style: new TextStyle( color: Colors.blue, locale: new Locale(_language, _country), ), child: new Scaffold( appBar: new AppBar(title: new Text("CJK Fonts")), body: new Center( child: new Column( children: <Widget>[ new Text("累令直刃漢"), new RaisedButton( onPressed: () { setLocale("ja", "JP"); }, child: new Text("ja-JP"), ), new RaisedButton( onPressed: () { setLocale("zh", "CN"); }, child: new Text("zh-CN"), ), new RaisedButton( onPressed: () { setLocale("zh", "TW"); }, child: new Text("zh-TW"), ), new RaisedButton( onPressed: () { setLocale("ko", "KR"); }, child: new Text("ko-KR"), ), new RaisedButton( onPressed: () { setLocale("vi", "VN"); }, child: new Text("vi-VN"), ), ], ), ), ), ); } void setLocale(String la, String co) { setState(() { _language = la; _country = co; }); } } ``` If you set the TextStyle with locale directly to Text, it works. ## Logs No errors. ``` [✓] Flutter (Channel dev, v0.4.2, on Mac OS X 10.12.6 16G1314, locale ja-JP) • Flutter version 0.4.2 at /Applications/flutter • Framework revision de332ec782 (3 days ago), 2018-05-07 14:13:53 -0700 • Engine revision e976be13c5 • Dart version 2.0.0-dev.53.0.flutter-e6d7d67f4b [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) • Android SDK at /Users/najeira/Library/Android/sdk • Android NDK at /Users/najeira/Library/Android/sdk/ndk-bundle • Platform android-27, build-tools 27.0.3 • ANDROID_HOME = /Users/najeira/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08) • All Android licenses accepted. [✓] iOS toolchain - develop for iOS devices (Xcode 9.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 9.2, Build version 9C40b • ios-deploy 1.9.2 • CocoaPods version 1.4.0 [✓] Android Studio (version 3.0) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. • Dart plugin version 171.4424 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08) [✓] IntelliJ IDEA Ultimate Edition (version 2018.1) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 23.1.3 • Dart plugin version 181.4203.498 [✓] VS Code (version 1.23.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Dart Code extension version 2.12.1 ```
framework,a: internationalization,a: typography,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-framework,triaged-framework
low
Critical
322,176,854
pytorch
Build from source with anaconda [caffe2]
I have a GPU so, when I run this command "CONDA_INSTALL_LOCALLY=1 BUILD_ENVIRONMENT=conda-cuda-macos ./scripts/build_anaconda.sh " "To build Caffe2 with different settings, change the dependencies in meta.yaml and the CMAKE_ARGS flags in conda/no_cuda/build.sh and run the script again." What i need to change in meta.yaml and CMAKE_ARGS flags? s ./scripts/build_anaconda.sh ++ uname '[' Linux == Darwin ']' conda_args=() caffe2_cmake_args=() conda_channel=() [[ conda-cuda-macos == cuda ]] ++ echo conda-cuda-macos ++ grep --only-matching -P '(?<=cuda)[0-9].[0-9]' cuda_ver= it doesn't start building but this I can successfully build the command without the GPU support. can you tell me the solution? - PyTorch or Caffe2: Caffe2 - How you installed PyTorch (conda, pip, source): Anaconda - Build command you used (if compiling from source): CONDA_INSTALL_LOCALLY=1 BUILD_ENVIRONMENT=conda-cuda-macos ./scripts/build_anaconda.sh - OS: Linux - PyTorch version: - Python version: 2.7 - CUDA/cuDNN version: 8/6.1 - GPU models and configuration: GTX 1050ti - GCC version (if compiling from source): 4.X - CMake version: - Versions of any other relevant libraries:
caffe2
low
Minor
322,256,498
go
brand: book table of contents
### What did you do? Read the 1.0.2 version of [brand book pdf](https://storage.googleapis.com/golang-assets/go-brand-book-v1.0.2.pdf). ### What did you expect to see? Very incorrect contents page on page 3. Section 1 doesn't contain 1.3.1,1.3.2,1.3.3 sub sections. Section 2 doesn't contain 2.0.2,2.3 sub section Section 3 have incorrect sub sections version. 2.0 and 2.0.1 instead of 3.0 and 3.0.1. By the way sub sections on 21 and 22 page have similar version (3.0) "the gopher" and "" ### What did you see instead? Valid contents page.
NeedsInvestigation
low
Minor
322,263,972
go
crypto/tls: GetCertificate called on resumed sessions
GetCertificate is called just before checking the client session ticket. If the ticket is valid and the session is resumed, that call is probably pointless. Off the top of my head, I can't remember why the server would need to know its own certificate in a resumed session, but there might be something I'm forgetting around renegotiation. Look into it, and if possible move the GetCertificate call after checkForResumption.
NeedsInvestigation
low
Minor
322,282,053
TypeScript
Remove Unnecessary lib.*.d.ts Entries
Why in `lib.es6.d.ts` do these exist: ```typescript interface String { /** Returns a string representation of a string. */ toString(): string; } interface Symbol { /** Returns a string representation of an object. */ toString(): string; } ``` Where this does not: ```typescript interface Boolean { /** Returns a string representation of a boolean. */ toString(): string; } ``` Cleanup redundant (inherited from `Object`) entries like `toString(): string` on some interfaces. > RE: https://github.com/Microsoft/TypeScript/pull/23721#issuecomment-388128341
Bug,Help Wanted,Domain: lib.d.ts
low
Minor
322,300,680
opencv
BFMatcher (OpenCL implementation) on ARM Mali T764
##### System information OpenCV => 3.4 Operating System / Platform => TinkerOS latest Compiler => g++ Hardware platform => Tinker Board 2GB ##### Detailed description I have run into a similar problem as this question [when](https://stackoverflow.com/questions/40218837/clenqueuendrangekernel-failed-with-error-out-of-resources/50288704#50288704) and [trying](https://github.com/opencv/opencv/issues/5737) to use the TAPI of OpenCV with the goal of using the GPU on the ASUS Tinkerboard. How does one change the local work size for a particular function? In my case I'm trying to implement ``` #include <opencv2/features2d.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/opencv.hpp> #include <opencv2/core/ocl.hpp> #include <vector> #include <iostream> #include <stdio.h> using namespace std; using namespace cv; void print_ocl_device_name() { vector<ocl::PlatformInfo> platforms; ocl::getPlatfomsInfo(platforms); for (size_t i = 0; i < platforms.size(); i++) { const cv::ocl::PlatformInfo* platform = &platforms[i]; cout << "Platform Name: " << platform->name().c_str() << "\n"; for (int j = 0; j < platform->deviceNumber(); j++) { cv::ocl::Device current_device; platform->getDevice(current_device, j); int deviceType = current_device.type(); cout << "Device " << j << ": " << current_device.name() << "\n"; } } ocl::Device default_device = ocl::Device::getDefault(); cout << "Used device: " << default_device.name() << "\n"; } int main(void) { print_ocl_device_name(); RNG r(239); Mat desc1(5100, 64, CV_32F); Mat desc2(5046, 64, CV_32F); r.fill(desc1, RNG::UNIFORM, Scalar::all(0.0), Scalar::all(1.0)); r.fill(desc2, RNG::UNIFORM, Scalar::all(0.0), Scalar::all(1.0)); for (int i = 0; i < 1000 * 1000; i++) { BFMatcher matcher(NORM_L2); UMat udesc1, udesc2; desc1.copyTo(udesc1); desc2.copyTo(udesc2); vector< vector<DMatch> > nn_matches; matcher.knnMatch(udesc1, udesc2, nn_matches, 2); printf("%d\n", i); } return 0; } ``` and the problem, clEnqueueNDRangeKernel' failed with error 'out of resources' (-5), occurs when I call the particular line matcher.knnMatch(). I navigated to /modules/src/matchers.cpp and changed the int block_size to 4, as clinfo says the preferred work size is 4. Recompiled the code with g++ but same error was thrown: OpenCL error CL_OUT_OF_RESOURCES (-5) during call: clEnqueueNDRangeKernel('BruteForceMatch_knnMatch', dims=2, globalsize=480x16x1, localsize=16x16x1) sync=false
priority: low,category: features2d,category: ocl,incomplete
low
Critical
322,309,862
rust
Use section/symbol ordering files for compiling rustc (e.g. BOLT)
The order in which code is located in binaries has an influence on how fast the binary executes because (as I understand it) it affects instruction cache locality and how efficiently the code is paged in from disk. Many linkers support specifying this order (e.g. LLD via `--symbol-ordering-file` and MSVC via `-ORDER`). The hard part, though, is to find an order that will actually improve things. The chromium project has a [tool](https://cs.chromium.org/chromium/src/tools/cygprofile/) for thisand somewhere else I've read that valgrind could be used for this too. The expected speedups are a few percent. Prerequisites: - [ ] Support function instrumentation in `rustc` (if using the chromium tool) similar to what GCC's `-finstrument-functions` does. - [ ] Compile an instrumented version of the compiler - [ ] Run the instrumented version of the compiler for a realistic test program (this should be less sensitive than full PGO) - [ ] Use the generated ordering file for building release artifacts The first point shouldn't be too hard. The rest, however, would big a big infrastructure investment. I hope that we'll get PGO support for our CI at some point. This symbol ordering business could then be part of that. cc @glandium @rust-lang/wg-compiler-performance @rust-lang/infra
A-LLVM,C-enhancement,I-compiletime,T-compiler,T-bootstrap,T-infra,S-blocked,WG-compiler-performance
medium
Major
322,322,616
flutter
showAboutDialog make licenseDialog background customizeable
My app has the same scarfold background color like the toolbar because of the Backdrop style. If i launch the licenseDialog all text ist on (in my case) grey blue background. I want to customize the dialog where the licenses will be shown.
c: new feature,framework,f: material design,P3,team-design,triaged-design
low
Major
322,347,726
go
cmd/compile: aggressive IMUL rewrites on AMD64 sometimes lead to performance regressions
``` image/draw name old time/op new time/op delta CopyOver-4 1.18ms ± 0% 1.52ms ± 0% +28.49% (p=0.008 n=5+5) ``` Bisecting from tip leads to b1df8d6ffa2c4c5be567934bd44432fff8f3c4a7. This is regression from go1.10.2. Performance delta is shown for b1df8d6ffa2c4c5be567934bd44432fff8f3c4a7 itself and it's parent (previous commit). Single IMUL is rewritten into mov+shift+lea. I can't reliably reproduce those results in free context, but they're stable for `CopyOver`.
Performance,NeedsInvestigation,compiler/runtime
low
Major
322,374,524
TypeScript
Typescript does not recognize function Boolean() as a check for undefined
I followed the submission guidelines. I prefer to check for a defined object using Boolean(object) rather than !!object, which I consider bad style. Typescript linter recognizes !! as a check for undefined but does not recognize Boolean() as a check for undefined. I could not find a tsconfig or tslint configuration setting related to this behavior. <!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --> 2.9.0-dev.20180511 (typescript@next) <!-- Search terms you tried before logging this (so others can find this issue more easily) --> "Boolean" "Boolean(" "function Boolean" **Code** This is not production code but a simple demonstration only to satisfy the expression tree. ```ts function booleanTest() { let value: Array<object> | undefined = undefined; if (Date.now() > 1) { value = [{}]; } if (Boolean(value)) { console.log(value.length); } } ``` **Expected behavior:** No Typescript linter errors **Actual behavior:** Typescript linter in VS Code displays an error "[ts] Object is possibly 'undefined'." with a red squiggly on the final reference to variable "value". **Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
Suggestion,Help Wanted
low
Critical
322,408,081
kubernetes
Managed ca-certs
/kind feature **What happened**: A common requirement of container base images is to provide ca-certs. For example, many of our addons are based on alpine purely to install the `ca-certificates` package. I believe this is an anti-pattern: - Revoking or adding new ca-certificates requires rebuilding & redeploying all workloads (that need it) - If my organization wants to add our internal CA, or decides we don't trust a "standard" CA, we need to build our own images. - There is poor visibility into which ca-certs are trusted across the cluster. A related problem is how to mount the Kubernetes root CA into pods. See https://github.com/kubernetes/community/pull/1973 for a discussion. **What you expected to happen**: There is an opportunity for Kubernetes to provide some value-add here with support for cluster-managed root CA bundles. This is already feasible to some extent by putting the `ca-certificates.crt` bundle in a config map and mounting it into containers at `/etc/ssl/`, but there are some shortcomings to this approach: 1. No cross-namespace config map references, so the CM needs to be cloned into every namespace 2. Every pod-spec needs to be modified to mount the ca-certs. 3. Lack of standardization means most containers will still build in the certs An ideal solution would: 1. Have a single cluster-scoped copy of the ca-cert data 2. Custom certs could easily be added as additional resources or k-v pairs 3. Certs are automatically injected (optionally disabled, a la automountServiceAccountToken) 4. Clusters include ca-certs by default (either Kubernetes provides a bundle, or load the master's host ca-certificates on startup) I'm not sure whether a new resource type (or CRD) is necessary here, or if ConfigMaps (either via x-namespace references or a new ClusterConfigMap) would be sufficient. WDYT? /sig auth
priority/backlog,kind/feature,sig/auth,help wanted,lifecycle/frozen
high
Critical
322,414,079
TypeScript
Extract function parameters or change function return type in mapped types
## Search Terms extract function parameters change function return type ## Suggestion Allow mapped types to change the return type of a function ## Use Cases I am writing a mocking framework. My system under test might be like this: ``` MyClass{ myClassFunction(paramOne: string, paramTwo: number): string{} } ``` but in my mocking framework I want to do this: ``` mockedObject .withFunction("myClassFunction") .withParameters("paramOneValue", 123) .wasCalled(); ``` to do the `withParameters` I need to type a function with the same parameters as defined on my class but with a different return type. ## Checklist My suggestion meets these guidelines: [ ] This wouldn't be a breaking change in existing TypeScript / JavaScript code [ ] This wouldn't change the runtime behavior of existing JavaScript code [ ] This could be implemented without emitting different JS based on the types of the expressions [ ] This isn't a runtime feature (e.g. new expression-level syntax)
Suggestion,Awaiting More Feedback
low
Major
322,428,108
kubernetes
Pod-specific dual client/serving cert auto-approval and validation
/kind feature **Problem**: As part of https://github.com/kubernetes/kubernetes/issues/62747, we need a way to authenticate serving pods (control plane & daemon set), i.e. provide serving certs. This proposal is for dealing with cases (2.a) & (3.a). **Idea**: 1. Pods initiate a certificate signing request where the CSR Extra info matches the Extra info encoded in the pod-scoped API token (from the TokenRequest API, which will eventually replace the current service account tokens). 2. CSR auto-approver verifies that the CSR extra info matches the extra info of the authenticated requester, and then auto-approves. 3. Provide a library for custom validation of service certs using the extra info cross referenced with the pod that is expected to handle the request. Credit to @mikedanese /sig auth
priority/awaiting-more-evidence,kind/feature,sig/auth,lifecycle/frozen
medium
Major
322,428,297
go
x/build/cmd/gerritbot: commit message source confuses a lot of people
Mapping from the title/first comment -> Gerrit commit message is confusing to almost everyone. It would be nice if this were either more clear or the commit message was determined by a more user-friendly method. Since PRs can have multiple commits, squashing all commit messages into one for the final commit message is one solution. Open to thoughts on others. /cc @bradfitz @bcmills @FiloSottile
help wanted,Builders,NeedsInvestigation
medium
Major
322,469,368
material-ui
[Collapse] Transition Breaks Inside Popover
<!--- Provide a general summary of the issue in the Title above --> <!-- Thank you very much for contributing to Material-UI by creating an issue! ❤️ To avoid duplicate issues we ask you to check off the following list. --> <!-- Checked checkbox should look like this: [x] --> - [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate. ## Expected Behavior <!--- If you're describing a bug, tell us what should happen. If you're suggesting a change/improvement, tell us how it should work. --> Unless I'm missing something, the Collapse transition should work as part of a Menu/Popover like the rest of the transitions. ## Current Behavior When setting Collapse as the TransitionComponent, the Menu/Popover contents appear at 0,0 and there is no animation. <!--- If describing a bug, tell us what happens instead of the expected behavior. If suggesting a change/improvement, explain the difference from current behavior. --> ## Steps to Reproduce (for bugs) <!--- Provide a link to a live example (you can use codesandbox.io) and an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant (which it most likely is). This codesandbox.io template _may_ be a good starting point: https://codesandbox.io/s/github/mui-org/material-ui/tree/v1-beta/examples/create-react-app If YOU DO NOT take time to provide a codesandbox.io reproduction, should the COMMUNITY take time to help you? --> This can be seen by adding `TransitionComponent={Collapse}` to the Menu demo. ~https://codesandbox.io/s/pxv0jkq3x~ Edit @eps1lon: https://codesandbox.io/s/menu-collapse-iliwj ## Your Environment <!--- Include as many relevant details about the environment with which you experienced the bug. --> | Tech | Version | |--------------|---------| | Material-UI | v1.0.0-beta.47 | | React | 16.3.2 | | browser | Chrome/Firefox tested. |
bug 🐛,component: Collapse
medium
Critical
322,476,459
rust
Can't use #[derive] and macro on a generic type at the same time
[I have this code:](https://play.rust-lang.org/?gist=7f62c00d6734da5fa2d7ed3309a2fb84&version=stable&mode=debug) ````rust macro_rules! typ { () => { i32 }; } #[derive(Debug)] struct MyStruct<T> { field: typ!(), } ```` The compiler gives this error: ```` error: `derive` cannot be used on items with type macros --> src/main.rs:7:12 | 7 | field: typ!(), | ^^^^^^ ```` [But if I change MyStruct into non-generic type](https://play.rust-lang.org/?gist=12f89b224e155bc18ce0f090d23cc54e&version=stable&mode=debug) ````rust macro_rules! typ { () => { i32 }; } #[derive(Debug)] struct MyStruct { field: typ!(), } ```` It works without any error. Why can't use #[derive] and macro on a generic type at the same time? Is it a compiler bug? [-> Mirror issue on StackOverflow](https://stackoverflow.com/questions/50296196/how-can-i-use-derive-on-a-type-containing-an-array-where-the-length-is-specif)
C-enhancement,A-macros,T-compiler
low
Critical
322,503,706
three.js
Adopting a Progressive Photorealistic Global Illumination in Three.JS
There has recently been a bunch of work towards progressive photo-realistic global illumination in WebGL. The best example I've seen of this is https://cl3ver.com renderer. There is some overlap between this and the high end rendering that Octane and other photorealistic GPU renderers do. I think it is time to add this to Three.JS. This is a meta-task that describes what needs to be done (this is in the spirit of the PBR meta task from 2015: https://github.com/mrdoob/three.js/issues/5847) The main components of this approach would be: Temporal Reprojection Anti-Aliasing https://github.com/mrdoob/three.js/issues/14050 Progressive Global Illumination via Instant Radiosity/Virtual Point Lights https://github.com/mrdoob/three.js/issues/14047 Progressive Soft Shadows via Light Source Sampling https://github.com/mrdoob/three.js/issues/14048 Screen-space Reflections https://github.com/mrdoob/three.js/issues/8248
Enhancement
high
Critical
322,504,505
three.js
Render to Unwrapped Texture (for baking)
It is possible to modify the main ThreeJS shaders so that we can enable rendering a final color to an unwrapped texture target. This involves using the world position for lighting, but the desired UV coordinate when writing the final results. This should be implemented in a fairly flexible fashion to Three.JS. (There may be an additional pass required after the main render pass to do extrapolation around each rendered component.)
Enhancement
low
Minor
322,504,525
three.js
Adding a Baking Workflow to Three.JS
This ties into the previous meta task that describes the progressive global illumination workflow. Basically once you can calculate global illumination, you likely want to bake it into the meshes for reuse. This would also be useful for ambient occlusion and shadow baking as well. There are two aspects to a baking workflow. UV Unwrapping via Mesh Color Textures https://github.com/mrdoob/three.js/issues/14053 Render to Unwrapped Texture https://github.com/mrdoob/three.js/issues/14054
Enhancement
low
Major
322,553,377
TypeScript
Generic enumerated type parameter narrowing (conditional types)
## Search Terms conditional type inference enum enumerated narrowing branching generic parameter type guard ## Suggestion Improve inference / narrowing for a generic type parameter and a related conditional type. I saw another closed-wontfix issue requesting generic parameter type guards, but a type guard should not be necessary for this case, since the possible values for the generic are enumerated. ## Use Cases (Names have been changed and simplified) I have a method that takes a KeyType (enumerated) and a KeyValue with type conditionally based on the enumerated KeyType. Depending on the KeyType value, the code calls method(s) specific to that type. The TS compiler is unable to tell that after I have checked the enumerated KeyType, the type of the KeyValue (string, number, etc) is known and should be able to be passed to a function that only accepts that specific KeyValue type. ## Examples ``` const enum TypeEnum { String = "string", Number = "number", Tuple = "tuple" } // The issue also occurs with // type TypeEnum = "string" | "number" | "tuple" interface KeyTuple { key1: string; key2: number; } type KeyForTypeEnum<T extends TypeEnum> = T extends TypeEnum.String ? string : T extends TypeEnum.Number ? number : T extends TypeEnum.Tuple ? KeyTuple : never; class DoSomethingWithKeys { doSomethingSwitch<TType extends TypeEnum>(type: TType, key: KeyForTypeEnum<TType>) { switch (type) { case TypeEnum.String: { this.doSomethingWithString(key); break; } case TypeEnum.Number: { this.doSomethingWithNumber(key); break; } case TypeEnum.Tuple: { this.doSomethingWithTuple(key); break; } } } doSomethingIf<TType extends TypeEnum>(type: TType, key: KeyForTypeEnum<TType>) { if (type === TypeEnum.String) { this.doSomethingWithString(key); } else if (type === TypeEnum.Number) { this.doSomethingWithNumber(key); } else if (type === TypeEnum.Tuple) { this.doSomethingWithTuple(key); } } private doSomethingWithString(key: string) { } private doSomethingWithNumber(key: number) { } private doSomethingWithTuple(key: KeyTuple) { } } ``` This should compile without errors if TS was able to tell that the switch statements or equality checks limited the possible type of the other property. I lose a lot of the benefits of TS if I have to cast the value to something else. especially if I have to cast `as any as KeyForTypeEnum<TType>` as has happened in my current codebase. If I'm doing something wrong or if there's already a way to handle this, please let me know. ## Checklist My suggestion meets these guidelines: [X] This wouldn't be a breaking change in existing TypeScript / JavaScript code [X] This wouldn't change the runtime behavior of existing JavaScript code [X] This could be implemented without emitting different JS based on the types of the expressions [X] This isn't a runtime feature (e.g. new expression-level syntax)
Suggestion,Needs Proposal
medium
Critical
322,554,703
rust
Error messages about modules are confusing to beginners
When a beginner [0] first tries to use modules, they are likely to do it wrong. The error message printed is misleading because it only mentions `extern crate foo` and never mentions ## Example Consider the following project: src/main.rs: ```rust use foo::say_hello; fn main() { say_hello(); } ``` src/foo.rs: ```rust pub fn say_hello() { println!("Hello, world!"); } ``` Running `cargo run` results in the following error message: ``` Compiling confusion v0.1.0 (file:///home/jeremy/tmp/confusion) error[E0432]: unresolved import `foo` --> src/main.rs:1:5 | 1 | use foo::say_hello; | ^^^ Maybe a missing `extern crate foo;`? error: aborting due to previous error For more information about this error, try `rustc --explain E0432`. error: Could not compile `confusion`. To learn more, run the command again with --verbose. ``` Naturally, one might try adding `extern crate foo;` to the top of main.rs. This changes the error message to: ``` Compiling confusion v0.1.0 (file:///home/jeremy/tmp/confusion) error[E0463]: can't find crate for `foo` --> src/main.rs:1:1 | 1 | extern crate foo; | ^^^^^^^^^^^^^^^^^ can't find crate error: aborting due to previous error For more information about this error, try `rustc --explain E0463`. error: Could not compile `confusion`. To learn more, run the command again with --verbose. ``` If a user reads the output of `rustc --explain E0432`, they might instead try changing main.rs to start with `use self::foo::say_hello;`, though this does not change the error message. Another common thing to try is adding `mod foo;` or `pub mod foo;` to the top of `foo.rs`. It is very unlikely that a user will stumble upon an actual solution (such as adding `mod foo;` to the top of `main.rs`). ## Suggestion The error message should also mention how to refer to local modules, not just external crates. If there is a file that matches the module name the user is trying to import, it would be especially helpful if the error message discussed how to correctly use that module from `main.rs`. ## Meta ``` $ rustc --version rustc 1.26.0 (a77568041 2018-05-07) ``` [0] or myself, after having not touched Rust in over a year
C-enhancement,A-diagnostics,T-compiler,D-newcomer-roadblock
low
Critical
322,590,259
godot
GIProbe indirect lighting on GridMaps not working
Godot 3.0.2 Win 7 64 bits GeForce 960 Hi there, I made a scene with an emissive material and Global Illumination, but lighting only throw on floor, but walls don't receive any bounces lighting. https://github.com/DevMagicLord/Godot3/blob/master/bugs/Giprobeissue.jpg While materials without normal map and roughness map receives all indirect lighting. https://github.com/DevMagicLord/Godot3/blob/master/bugs/giprobeissue2.jpg Materials with normal map and roughness, metallic maps, needs to receive lighting bounces.
bug,topic:rendering,confirmed,topic:3d
medium
Critical
322,592,253
three.js
Texture preservation for mesh simplification(LOD)
##### Texture preservation for mesh simplifier Here's a model reduced to 40% of original vertex count with textures preserved. With this you can generate LOD instead of baking it. This modification of SimplifyModifier adds texturing support and is replacing face UVs on removed vertex to UV coordinates of remaining vertex. More or less works. I can make a PR unless you want to improve this first. https://codesandbox.io/s/5018onxy1p Update: Details: Added a check if percentage of texture coordinates change is disproportionately higher than vertex shift distance(percentage of distance to diameter of bounding sphere) then no UV change will be applied on face at removed vertex position. https://codesandbox.io/s/jvy6x7r3my This seems to improve the end result and strange texture stretching but I don't think it's fixing the root cause of the problem. ##### Three.js version - [ x] Dev - [ x] r92 ##### Browser - [x] All of them - [ ] Chrome - [ ] Firefox - [ ] Internet Explorer ##### OS - [x] All of them - [ ] Windows - [ ] macOS - [ ] Linux - [ ] Android - [ ] iOS
Enhancement
medium
Major
322,592,424
pytorch
[feature request] Global GPU Flag
The [PyTorch 0.4 Migration Guide](https://pytorch.org/2018/04/22/0_4_0-migration-guide.html), simplifies writing device-agnostic code as follows: ```python # at beginning of the script device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") ... # then whenever you get a new Tensor or Module # this won't copy if they are already on the desired device input = data.to(device) model = MyModule(...).to(device) ``` However, this is still not clean. Ideally, we would like PyTorch to move everything over to the GPU, if it's available... much like TensorFlow. I tried setting the global tensor type to a cuda tensor using the ```torch.set_default_tensor_type()``` method. However, there are some fundamental problems with setting the default tensor type. * Dataloaders give normal (non-cuda) tensors by default. They have to be manually cast using the `Tensor.to()` method. * Many methods are simply not implemented for `torch.cuda.*Tensor`. Thus, setting the global tensor type to cuda fails. * Conversions to numpy using the `numpy()` method aren’t available for cuda tensors. One has to go `x.cpu().numpy()`. Although this chain is agnostic, it defeats the purpose. <hr> I find that I use methods like `.to(device)` and `.cpu()` far too often in my projects. In my view, _it makes the code more verbose than it needs to be_ and makes it just a little harder to read. **I think that there is room for a global `use_gpu` flag that can enable developers to run the entire subsequent code in the GPU, where required.** Specifically, my request is the following: #### 1. Abolish need for the `.to(device)` suffix: Circumvent it by letting the developer set the device using a global method like `torch.set_default_device()` or a convinience method/flag like `use_gpu` Then, whenever, an error is encountered because a CUDA tensor is expected in place of a regular tensor or vice-versa, automatically cast the tensor to the expected device. Additionally, a. Move `nn.Module` automatically to the default device. b. Move the yield of `DataLoader`s to the default device. Prevent the need to manually cast to the default device. #### 2. Add the numpy() method to cuda tensors: The existing way is to move the tensor to cpu first. Thus, we have `x.cpu().numpy()`, which is agnostic but redundant. #### 3. Use GPU by default if available: PyTorch is built from the ground up with the Deep Learning community in mind. With most Deep Learning done on GPUs, they be considered as the default device automatically. _Let PyTorch give first preference to the GPU._
feature,module: cuda,triaged
medium
Critical
322,611,727
rust
Unhelpful error with "overlapping" never applicable impls
These two implementations are overlapping (it's allowed to write `where for<'a> M: B<'a>` even when `M` doesn't implent `B<'a>`) but the error doesn't say this. ```rust trait A { /* ... */ } trait B<'a> {} struct M; impl A for M where for<'a> M: B<'a> { /* ... */ } impl A for M where for<'a> M: B<'a> { /* ... */ } fn main() {} ``` Compiler output: <details> ```text Compiling playground v0.0.1 (file:///playground) error[E0283]: type annotations required: cannot resolve `M: A` --> src/main.rs:8:6 | 8 | impl A for M where for<'a> M: B<'a> {} | ^ error: aborting due to previous error For more information about this error, try `rustc --explain E0283`. error: Could not compile `playground`. To learn more, run the command again with --verbose. ``` </details> cc #48214 which will make this issue easier to come across.
A-trait-system,T-lang,C-bug
low
Critical
322,619,305
TypeScript
strictNullChecks false positives in case clause
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section! Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ Please fill in the *entire* template below. --> <!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --> **TypeScript Version:** 2.9.0-dev.20180512 <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** **Code** ```ts // @strictNullChecks: true function test1(param?: {prop: string}) { switch (param && param.prop) { case 'foo': return param.prop; // error: 'param' is possibly undefined } } function test2(param: {prop?: string}) { switch (param && param.prop) { case 'foo': return param.prop.charAt(0); // error: 'param.prop' is possibly undefined } } ``` **Expected behavior:** Compiles without error. **Actual behavior:** strictNullChecks errors as described in the comments above. **Playground Link:** https://agentcooper.github.io/typescript-play/?noImplicitReturns=false#code/GYVwdgxgLglg9mABFApgZygRgBQAcCGATvgLYD8AXIgN66Fy5UaExgDmAvgJQ0BQiiNAHcYUCAAtEeIqUQAyOYgLESAOjoMe1fgMQR8aFIgDkwOHGMUduxIRRQQhJMtLr6uANyIA9N8QpCekIqYxcSY0QYNCU4NDQYACMAGwBPRHAAExRgVhQMnQ5eQt5QSFgEZHQoACZpFSpad0pBKBZ2bj4BYVEJKTD5RTC3TU7dfUMTMwsrGwE7ByclGTUNXFUJIgBBKGwABi4vX39AuGCTIdWIqJi4xNT0sCycsDyCoqA **Related Issues:** #23818
Bug
low
Critical
322,625,286
rust
Confusing error message when trying to cast usize to fat pointer
Trying to cast a `usize` to a fat pointer (in this case `*const T` where `T: ?Sized`) gives a confusing error message (in that it's not immediately obvious that it's invalid because it's a fat pointer): ``` error[E0606]: casting `usize` as `*const T` is invalid | 38 | self.0 as *const T | ^^^^^^^^^^^^^^^^ ``` If you try to cast to a thin pointer, then to a fat pointer, it gives a better error: ``` error[E0607]: cannot cast thin pointer `*const core::alloc::Opaque` to fat pointer `*const T` | 38 | self.0 as *const Opaque as *const T | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` It would be more obvious if doing the former gave a message like `cannot cast usize to fat pointer`, maybe
C-enhancement,A-diagnostics,T-compiler
low
Critical
322,632,157
flutter
On Android 5 (API 21) Appbar is shown behind the header on recent apps list
On Android when recent apps list is shown, appbar is still visible under the header. Can be observed more easily when `AppBar` `backgroundColor` is given explicitly ```dart return new Scaffold( appBar: new AppBar( // Here we take the value from the MyHomePage object that was created by // the App.build method, and use it to set our appbar title. title: new Text(widget.title), backgroundColor: Colors.green, ), body: new Center( ``` ![screen shot 2018-05-14 at 01 17 26](https://user-images.githubusercontent.com/5124597/39972284-9ad500b2-5714-11e8-9d00-808aea13b96c.png)
platform-android,framework,f: material design,a: fidelity,e: OS-version specific,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-android,triaged-android
low
Major
322,663,405
rust
#[derive] fails to detect associated type when qualified path is used
The deriving code scans the field types in order to generate bounds on associated types, if they happen to be used as a field type (this isn't foolproof but it catches a lot of cases). https://github.com/rust-lang/rust/blob/9fae1537462bb10fd17d07816efc17cfe4786806/src/libsyntax_ext/deriving/generic/mod.rs#L350-L352 The comment in this code implies that `field: T::Assoc` and `field: <T as Trait>::Assoc` would both work. However, the second one is missed and the required bound is not generated, resulting in a type error: ```rust #[derive(Debug)] struct Foo<T: FromStr> { field: <T as FromStr>::Err } ``` ``` error[E0277]: `<T as std::str::FromStr>::Err` doesn't implement `std::fmt::Debug` --> expr.rs:18:77 | 18 | field: <T as FromStr>::Err | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `<T as std::str::FromStr>::Err` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `<T as std::str::FromStr>::Err` = help: consider adding a `where <T as std::str::FromStr>::Err: std::fmt::Debug` bound = note: required because of the requirements on the impl of `std::fmt::Debug` for `&<T as std::str::FromStr>::Err` = note: required for the cast to the object type `std::fmt::Debug` ``` cc #26925.
A-macros,A-associated-items,T-compiler,C-bug,T-types
low
Critical
322,668,948
pytorch
[Caffe2] Build broken on macOS High Sierra: can't find sys headers in /usr/local/include.
Information about what failed when building from HEAD (see error logs.) /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_8a5ea.dir/build.make CMakeFiles/cmTC_8a5ea.dir/build Building CXX object CMakeFiles/cmTC_8a5ea.dir/src.cxx.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DCAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.9 -o CMakeFiles/cmTC_8a5ea.dir/src.cxx.o -c /usr/local/anaconda3/conda-bld/caffe2_1526270409265/work/build/CMakeFiles/CMakeTmp/src.cxx /usr/local/anaconda3/conda-bld/caffe2_1526270409265/work/build/CMakeFiles/CMakeTmp/src.cxx:1:10: fatal error: 'glog/stl_logging.h' file not found #include <glog/stl_logging.h> ^~~~~~~~~~~~~~~~~~~~ 1 error generated. make[1]: *** [CMakeFiles/cmTC_8a5ea.dir/src.cxx.o] Error 1 make: *** [cmTC_8a5ea/fast] Error 2 Source file was: #include <glog/stl_logging.h> int main(int argc, char** argv) { return 0; } I ran "brew install glog" successfully. After install, the file is there: $ ls /usr/local/include/glog/stl_logging.h /usr/local/include/glog/stl_logging.h But the error still persists as you can see from the output above that '/usr/local/include' is not on the system headers path search? Shouldn't this path be added to CMake? Default on latest OS points to the SDK headers and seems to cause this sort of issues when package is installed with homebrew.
caffe2
low
Critical
322,708,387
flutter
Provide a Backdrop Widget
Please provide a backdrop widget in flutter library
c: new feature,framework,f: material design,P3,team-design,triaged-design
medium
Major
322,709,814
opencv
MSER different results in transition from 2.4 to 3 version
Due to the facts that default parameters value have not changed in transition from opencv2.4 to 3 we expect to not get different regions with our previous parameters setting but we get absolutely different and wrong regions with those parameters (exactly the same, except the mask which is not an argument for mser anymore) in opencv3 version and finding the reason and new parameter setting wasn't straight forward at all. As I reviewed logs of changes in these transition, I found that there were some bug fixes so we expect to get better results in version 3 but it was vice versa. I realized that there are huge modifications in updateTree function as it use the delta parameter in a different way. The question is how should we change the parameters to get exact results as 2.4 function and why the description of delta in opencv docs has no changes? System information (version) OpenCV => 3.1 3.3 2.4 Operating System / Platform => Ubuntu, Embedded linux
category: imgproc,incomplete,needs reproducer
low
Critical
322,754,722
material-ui
[Table] Improve mobile display / responsive stacking
# Feature Request Can you guys make the table responsive to break into pieces with its Heading while right now we have to scroll left/right in mobile devices? ## Expected Behavior ![image](https://user-images.githubusercontent.com/25475456/39991642-ea7b312e-578f-11e8-8aed-a2c380c87a0c.png) **Example** : - https://codepen.io/zavoloklom/pen/yLmZeQ - https://css-tricks.com/examples/ResponsiveTables/responsive.php - https://semantic-ui.com/collections/table.html ## Current Behavior ![image](https://user-images.githubusercontent.com/25475456/39991560-b45557a0-578f-11e8-94d6-8ea2d8d5c390.png)
new feature,waiting for 👍,component: table,mobile
medium
Critical
322,839,617
javascript
Shown Example Is Not Appropriate for arrays--callback-return
[4.6 in Readme](https://github.com/airbnb/javascript#arrays--callback-return) last example is shown as ``` inbox.filter((msg) => { const { subject, author } = msg; if (subject === 'Mockingbird') { return author === 'Harper Lee'; } return false; }); ``` but its not a example of `arrays--callback-return`, its illustrate `avoid of else`, when using return statement.
needs followup,editorial
low
Minor
322,842,935
flutter
add2app: flutter run --use-application-binary should launch by Intent
In add2app scenarios, a single Android package may have multiple launchable Activities, only one of which should be the default one. Parsing `aapt` output doesn't seem to be able to tell us which one is default, whereas launching by specific intent does the correct thing: ``` shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER <package_name> ``` @devoncarew Would you be concerned about extracting only the package name from `aapt` output instead of also the Activity name as currently done in https://github.com/flutter/flutter/pull/5307?
platform-android,tool,engine,a: existing-apps,P2,team-android,triaged-android
low
Minor
322,933,797
godot
Editor randomly freezes computer
**Godot version:** 3.0.2 Stable **OS:** Windows 8.1 laptop _edit: more specs_ **CPU:** Intel Core i3-5005U **Graphics:** IntelHD 5500 I've been using Godot for around a week or so, but I've been getting a very serious problem: in random instances, my *whole computer* freezes, including the cursor. I have to hard reset it. It doesn't happen often enough that I can reproduce the issue (it really feels random), but it happens often enough that I already got this three times in the span of a week. If I had to guess what triggers it, i noticed it seems to happen more often during script editing, but I don't intend to try and reproduce this bug, hard-resetting is obviously something I want to avoid. I'm liking the experience with Godot for now, so I'd love to get that fixed, as I can't use an editor that will bring my PC to a halt. Any ideas?
bug,topic:editor,confirmed
high
Critical
322,954,466
rust
use `evaluate_obligation` to decide when to do unsized coercions
As part of the coercion logic, we sometimes invoke `coerce_unsized`: https://github.com/rust-lang/rust/blob/cb1ce7ddf8e791faddc9760ca505d513ce1c00c9/src/librustc_typeck/check/coercion.rs#L457 This would e.g. coerce from `&[T; 32]` to `&[T]` or from `Arc<T>` to `Arc<dyn Trait>` where `T: Trait`. To decide whether or not we are going to do this, we want to check if `Arc<T>: CoerceUnsized<Arc<dyn Trait>>` is implemented (or something like that). We do this in this funky little loop here: https://github.com/rust-lang/rust/blob/cb1ce7ddf8e791faddc9760ca505d513ce1c00c9/src/librustc_typeck/check/coercion.rs#L538-L552 This kind of pulls out all the (transitive) requires to prove `CoerceUnsized` and ignores the rest. However, if we ever hope to define coercions in terms of the trait system, what we really *ought* to be doing is using an `evaluate_obligation` check. Hopefully we can get away with this backwards compatibly. @eddyb told me at some point -- iirc -- that the reason this loop exists is for diagnostics. So making this change may require some work on that point. cc @leodasvacas @mikeyhew
C-enhancement,A-trait-system,T-compiler,A-coercions,T-types,S-types-tracked
low
Major
323,042,001
godot
Audio with compress mode set to RAM always plays from the beginning
<!-- Please search existing issues for potential duplicates before filing yours: https://github.com/godotengine/godot/issues?q=is%3Aissue --> **Godot version:** 47d4a01 **Issue description:** I don't know if this is just a limitation or not, but if a audio file has its compress mode set to RAM (Ima-ADPCM), it will ignore the `from_position` argument in the `play` method.
bug,confirmed,topic:audio
low
Major
323,068,573
electron
Disallow permission requests by default
**Is your feature request related to a problem? Please describe.** Electron is known for being insecure. It should come with better security defaults. **Describe the solution you'd like** The Electron [security checklist](https://github.com/electron/electron/blob/master/docs/tutorial/security.md#4-handle-session-permission-requests-from-remote-content) recommends disallowing permission requests for features the app doesn't need. It's a big security gap that this is opt-out rather than opt-in. I recommend making all permission requests denied by default and let the user instead explicitly opt into what they need. That's also how Chrome works. So the default would become something like this: ```js const {session} = require('electron'); session.defaultSession.setPermissionRequestHandler((webContents, permission, callback) => { callback(false); }); ```
enhancement :sparkles:
low
Major
323,077,857
react
Provide ways to do post-mortem analysis of “Maximum update depth exceeded” error in production.
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Feature **What is the current behavior?** Our error logging systems has been reporting this error in production: “Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.” However, we can’t reliably reproduce this error and it only affects a small percentage of our users. Moreover, we have more than 1,000 in-house components and several third-party components. So, it’s impractical to audit every single component to find out what caused it. **What is the expected behavior?** It would be much easier for us to debug if, when the nested update count exceeds 1,000 (current NESTED_UPDATE_LIMIT), we could see what components are involved in this nested update chain. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** We are using React 16.3.1.
Type: Feature Request
medium
Critical
323,108,216
TypeScript
[Regression] TS2562 - mixins cannot accept generic types
**TypeScript Version:** 2.6.0 and more **Search Terms:** mixin, 2.6. **Code** ```ts export interface Constructor<T = any> extends Function { new(...args: any[]): T; } class A<T> { public a: T; } class B<T> { public b: T; } function Mixin<T>(...classes: any[]): Constructor<T> { return function() { // whatever, not the purpose of the demonstration } as any; } interface IAB<T, U> extends A<T>, B<U> {} // on typescript 2.6.0 and more, its no more possible to use generic types into mixins.... class AB<T, U> extends Mixin<IAB<T, U>>(A, B) { } // on typescript 2.6.0 we're forced to write // class AB<T, U> extends Mixin<IAB<any, any>>(A, B) {} // so we loose type checking... // intentional type error class testClass extends AB<boolean, string> { public a: number; // before 2.6.0 => type of 'a' properly detected as wrong, boolean expected } ``` **Expected behavior:** Like before typescript 2.6.0, extending a class with a mixin which takes generic types should be allowed. Using mixin is a really common usage in js/ts to build classes which implement/inherit properties from more than one classe (sometimes named 'factories'). Before 2.6.0, typescript properly detected the union of class having generic types, but currently this generates TS2562 errors, so its no more possible to construct typed generic mixins. In a more generic way: ```ts function A<T>() { return class {}; } // should be allowed class B<T> extends A<T>() {} ``` **Actual behavior:** TS2562, Base class expression cannot reference class type parameters (on T and U) **Playground Link:** [here](https://www.typescriptlang.org/play/#src=export%20interface%20Constructor%3CT%20%3D%20any%3E%20extends%20Function%20%7B%0D%0A%20%20new(...args%3A%20any%5B%5D)%3A%20T%3B%0D%0A%7D%0D%0A%0D%0Aclass%20A%3CT%3E%20%7B%0D%0A%20%20public%20a%3A%20T%3B%0D%0A%7D%0D%0A%0D%0Aclass%20B%3CT%3E%20%7B%0D%0A%20%20public%20b%3A%20T%3B%0D%0A%7D%0D%0A%0D%0Afunction%20Mixin%3CT%3E(...%20_classes%3A%20any%5B%5D)%3A%20Constructor%3CT%3E%20%7B%0D%0A%20%20return%20function()%20%7B%0D%0A%20%20%20%20%2F%2F%20whatever%0D%0A%20%20%7D%20as%20any%3B%0D%0A%7D%0D%0A%0D%0A%0D%0Ainterface%20IAB%3CT%2C%20U%3E%20extends%20A%3CT%3E%2C%20B%3CU%3E%20%7B%7D%0D%0Aclass%20AB%3CT%2C%20U%3E%20extends%20Mixin%3CIAB%3CT%2C%20U%3E%3E(A%2C%20B)%20%7B%0D%0A%20%20%0D%0A%7D) **Related Issues:** Partially related https://github.com/Microsoft/TypeScript/issues/19668
Suggestion,Awaiting More Feedback
medium
Critical
323,123,506
pytorch
[Caffe2]How to set lr_mult and decay_mult in Conv layer?
In facebookresearch/detectron, I see a conv layer is add by: conv_rpn_fpn = model.Conv( bl_in, 'conv_rpn_fpn' + slvl, dim_in, dim_out, kernel=3, pad=1, stride=1, weight_init=gauss_fill(0.01), bias_init=const_fill(0.0) ) However, I don't find any parameter statement about lr_mult and decay_mult like that in a caffe conv layer. Could you please give me an example? Thanks a lot! If you have a question or would like help and support, please ask at our [forums](https://discuss.pytorch.org/). If you are submitting a feature request, please preface the title with [feature request]. If you are submitting a bug report, please fill in the following details. ## Issue description Provide a short description. ## Code example Please try to provide a minimal example to repro the bug. Error messages and stack traces are also helpful. ## System Info Please copy and paste the output from our [environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py) (or fill out the checklist below manually). You can get the script and run it with: ``` wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py # For security purposes, please check the contents of collect_env.py before running it. python collect_env.py ``` - PyTorch or Caffe2: - How you installed PyTorch (conda, pip, source): - Build command you used (if compiling from source): - OS: - PyTorch version: - Python version: - CUDA/cuDNN version: - GPU models and configuration: - GCC version (if compiling from source): - CMake version: - Versions of any other relevant libraries:
caffe2
low
Critical
323,151,532
pytorch
the latest version of caffe2, Which file is the function loadToNCHW()
I installed caffe2 with https://github.com/pytorch/pytorch.git. the function loadToNCHW() didn't find.
caffe2
low
Minor
323,207,942
opencv
Video reader can't read new frames after reaching the end of continuously written video
##### System information (version) - OpenCV => 3.4.1 - Operating System / Platform => Linux Ubuntu 16.04 x86_64 - Compiler => gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 ##### Detailed description It is currently possible to read and write the same video file if container and codec supports reading of incomplete files. Consider having continuously generated .MKV file, for example captured from remote stream with ``ffmpeg`` - so, we can have video file continuously written. And we also can read and process it with OpenCV. And while we're reading slower than writing everything is OK, we can read and process video continuously. But once we reach end of video by reading the last frame on the moment of reading, we can't continue reading regardless of video is still being written. And if we wait before reading last frame (we need to know that upfront!) we can continue reading as long as new frames are written. ##### Steps to reproduce 1. Start generating video file, i.e. by capturing from remote video stream to .MKV ```bash ffmpeg -i https://bitdash-a.akamaihd.net/content/sintel/hls/video/1500kbit.m3u8 \ -vcodec libx264 capture.mkv ``` 2. After several seconds start reading captured video with OpenCV ```bash ./testread -f=capture.mkv ``` ```.cpp // testread.cpp #include <iostream> #include <string> #include <unistd.h> #include "opencv2/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/video.hpp" #include "opencv2/highgui.hpp" using namespace std; using namespace cv; int main(int argc, const char** argv) { cv::CommandLineParser cmd(argc, argv, "{ c camera | | use camera }" "{ f file | ../data/vtest.avi | input video file }" "{ m method | mog | method (mog, mog2, gmg, fgd) }" "{ h help | | print help message }"); if (cmd.has("help") || !cmd.check()) { cmd.printMessage(); cmd.printErrors(); return 0; } bool useCamera = cmd.has("camera"); string file = cmd.get<string>("file"); string method = cmd.get<string>("method"); VideoCapture cap; if (useCamera) cap.open(0); else cap.open(file); if (!cap.isOpened()) { cerr << "Can not open camera or video file" << endl; return -1; } Mat frame; int frameNumber = 0; for(;;) { int64 start = cv::getTickCount(); cap >> frame; if (frame.empty()) { std::cout << (cap.isOpened() ? "opened " : "closed ") << "Wait for 1s... " << "(frameNumber=" << frameNumber << ")" << std::endl; usleep(1000000); continue; } if (frameNumber % 100 == 0) { double fps = cv::getTickFrequency() / (cv::getTickCount() - start); std::cout << "FPS : " << fps << std::endl; } frameNumber++; } return 0; } ``` Output will look like that: ``` ... FPS : 321.997 FPS : 320.36 FPS : 363.244 FPS : 226.603 opened Wait for 1s... (frameNumber=1063) opened Wait for 1s... (frameNumber=1063) opened Wait for 1s... (frameNumber=1063) ... ``` ##### Expected behaviour We should be able to continue reading frames after delay because video is still being written.
priority: low,category: videoio
low
Critical
323,294,132
go
reflect: permit unexported fields in StructOf
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? go version go1.10.2 linux/amd64 ### Does this issue reproduce with the latest release? yes ### What did you do? ``` package main import "fmt" import "reflect" func main() { type T = struct { x int } fmt.Println(reflect.TypeOf(T{})) // struct { x int } var n int tn := reflect.TypeOf(n) // panic: reflect.StructOf: field "x" is unexported but missing PkgPath tt := reflect.StructOf([]reflect.StructField{ {Name: "x", Type: tn, Anonymous: false}, }) fmt.Println(tt) } ``` ### What did you expect to see? not panic. ### What did you see instead? panic. If it really should panic, it should be documented.
help wanted,NeedsFix
medium
Major
323,298,172
go
reflect: the string representation of the type with anonymous fields and created by StructOf looks the fields are not anonymous
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? go version go1.10.2 linux/amd64 ### Does this issue reproduce with the latest release? yes ### What did you do? ``` package main import "fmt" import "reflect" type MyInt int func main() { type T = struct { MyInt } fmt.Println(reflect.TypeOf(T{})) // struct { main.MyInt } var n MyInt tn := reflect.TypeOf(n) // panic: reflect.StructOf: too many methods tt := reflect.StructOf([]reflect.StructField{ {Name: "MyInt", Type: tn, Anonymous: true}, }) fmt.Println(tt) // struct { MyInt main.MyInt } } ``` ### What did you expect to see? ``` struct { main.MyInt } struct { main.MyInt } ``` ### What did you see instead? ``` struct { main.MyInt } struct { MyInt main.MyInt } ```
NeedsInvestigation,compiler/runtime
low
Minor
323,308,151
vscode
Add commands to outline elements
The outline view should offer commands that can be run straight from an element. E.g. rename but also triggering things like find references et al. Similar to the editor-context-menu this could be made open for contributions
feature-request,outline
medium
Critical
323,324,044
go
x/build/cmd/relui: collect open source NOTICES into top-level NOTICES file?
We should probably make x/build/cmd/release collecting all the misc LICENSE/NOTICE files from the packages we depend on and concatenate them all together into one top-level NOTICES file next to our LICENSE file in Go's release. We'd also need to make such NOTICE files for each directory where the notice is currently in the source code at the top. Look at Debian's packaging of Go to find the list. /cc @rsc @FiloSottile @ianlancetaylor @andybons @bcmills
help wanted,Builders,NeedsFix
low
Minor
323,386,507
go
proposal: io: add OnceCloser helper
Proposal, to add to the `io` package: ```go // OnceCloser returns a Closer wrapping c that guarantees it only calls c.Close // once and is safe for use by multiple goroutines. Each call to the returned Closer // will return the same value, as returned by c.Close. func OnceCloser(c Closer) Closer { return &onceCloser{c: c} } ``` With implementation like: ```go type onceCloser struct { c Closer once sync.Once err error } func (c *onceCloser) Close() error { c.once.Do(c.close) return c.err } func (c *onceCloser) close() { c.err = c.c.Close() } ``` This would let people safely write code like: ```go oc := io.OnceCloser(file) defer oc.Close() .... if err != nil { return nil, err } if err := oc.Close(); err != nil { return nil, err } ``` ... without worrying about double calls to `file.Close`, which is undefined since https://golang.org/cl/8575043 https://golang.org/pkg/io/#Closer > // The behavior of Close after the first call is undefined. > // Specific implementations may document their own behavior. /cc @bcmills @mpvl @ianlancetaylor
Proposal,Proposal-Hold
medium
Critical
323,398,404
flutter
FlutterDriver.scrollUntilVisible scrolls when the item to find is onscreen
`scrollUntilVisible` should not attempt to scroll when the item to find is onscreen, but we often see one extra scroll. This is particularly problematic when the item to find is at the top of the screen, in which case we may scroll it offscreen, resulting in a failure in the [`scrollIntoView` call](https://github.com/flutter/flutter/blob/ae8586cfa1cdbfda89048ecf6f148e401a15d4a1/packages/flutter_driver/lib/src/driver/driver.dart#L493) returns from that function.
tool,t: flutter driver,P2,team-tool,triaged-tool
low
Critical
323,406,891
rust
Doctests don't work in bin targets, non-public items
It's surprising that doctests sometimes don't run at all, and there's no warning about this. ```sh cargo new foo --bin ``` ```rust /// ```rust /// assert!(false); /// ``` fn main() { println!("Hello, world!"); } ``` ```sh cargo test --all ``` I'd expect the above to fail, but it looks like the doc-comment code is never ran. Even if I explicitly enable doctests for the binary: ```toml [[bin]] name = "foo" path = "src/main.rs" doctest = true ``` they still aren't run. (moved from https://github.com/rust-lang/cargo/issues/5477)
T-rustdoc,C-enhancement,A-doctests
high
Critical
323,419,885
TypeScript
Simplify error messages against intersections of weak types
I spoke a bit with @sandersn about ways we can tackle the type madness issue (#14662). I noted that JSX scenarios are much more broadly applicable right now and are pretty prevalent given the sorts of type arithmetic we see a lot of in the React community. :smiley: # Problem: JSX optional attributes make errors too hard to read ```tsx interface FooProps { name: string; age: number; } class Foo extends React.Component<FooProps> { constructor(props: FooProps) { super(props) } render() { const {name, age} = this.props; return <div>I'm {name} and am {age} years old</div>; } } // Type '{ blah: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Foo> & Readonly<{ children?: ReactNode; }> & Reado...'. // Type '{ blah: number; }' is not assignable to type 'Readonly<FooProps>'. // Property 'name' is missing in type '{ blah: number; }'. <Foo blah={10} />; ``` # Proposal When doing relation checks against an intersection target, if a check fails, see if relating against the same type with weak types removed would result in the same outcome. If so, use *that* comparison when elaborating types. The great part is that this actually solves a broader set of problems than just JSX.
Suggestion,Domain: Error Messages,Experience Enhancement
low
Critical
323,577,767
pytorch
Inconsistent interactions of PyTorch tensors and NumPy ops
```python import numpy import torch type(numpy.sum([torch.tensor(0, requires_grad=True)])) # returns torch.Tensor type(numpy.sum([torch.tensor(0)])) # returns numpy.int64 ``` cc @mruberry @rgommers @heitorschueroff
triaged,module: numpy
low
Major
323,580,637
flutter
OverscrollNotification does not work on iOS
## Steps to Reproduce 1. Add an OverscrollNotification to a ListView, take Gallery as an example 2. Scroll down to the bottom of the list 3. There's no notification callback on iOS, while OK on Android. Modify the Gallery code as an example, list_demo.dart line 237 The code after modified: ```dart body: new Scrollbar( child: new NotificationListener<OverscrollNotification>(child: new ListView( padding: new EdgeInsets.symmetric(vertical: _dense ? 4.0 : 8.0), children: listTiles.toList(), ), onNotification: (OverscrollNotification notification) { print("====shubin debug: notification ${notification.overscroll}"); if (notification.overscroll > 0 ) { print("====shubin debug: notification>0 ${notification.overscroll}"); } return false; }, ), ), ``` The code before modified: ```dart body: new Scrollbar( child: new ListView( padding: new EdgeInsets.symmetric(vertical: _dense ? 4.0 : 8.0), children: listTiles.toList(), ), ), ), ``` To solve this problem, we're using a alternative way on iOS like below. But is the above a problem? ```dart void _handleScrollNotification() { if (widget.controller.position.pixels > widget.controller.position.maxScrollExtent) { if (widget.adapter.hasMore()) { widget.adapter.loadMore(); } } } ``` ## Logs There are logs like "====shubin debug: notification" on Android, but failed on iOS. Flutter doctor -v: <!-- Finally, paste the output of running `flutter doctor -v` here. --> ``` ✓] Flutter (Channel beta, v0.3.2, on Mac OS X 10.12.6 16G1314, locale zh-Hans-HK) • Flutter version 0.3.2 at /Users/guoyou/projects/flutter • Framework revision 44b7e7d3f4 (4 weeks ago), 2018-04-20 01:02:44 -0700 • Engine revision 09d05a3891 • Dart version 2.0.0-dev.48.0.flutter-fe606f890b [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) • Android SDK at /Users/guoyou/Library/Android/sdk • Android NDK at /Users/guoyou/Library/Android/sdk/ndk-bundle • Platform android-27, build-tools 27.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) • All Android licenses accepted. [✓] iOS toolchain - develop for iOS devices (Xcode 9.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 9.2, Build version 9C40b • ios-deploy 1.9.2 • CocoaPods version 1.4.0 [✓] Android Studio (version 3.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 24.2.1 • Dart plugin version 173.4700 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) [✓] IntelliJ IDEA Community Edition (version 2017.2.3) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin installed • Dart plugin version 172.3968.27 [✓] Connected devices (3 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator) • iPhone (3) • cd8bf03b9894bcc00eb25fdae9473ff0b2df095a • ios • iOS 10.3.2 • iPhone X • 8D4A21F9-E417-43CE-8B40-52CEAB6B7D04 • ios • iOS 11.2 (simulator) ```
platform-ios,framework,f: material design,f: scrolling,f: cupertino,d: api docs,customer: alibaba,has reproducible steps,P2,workaround available,found in release: 3.7,found in release: 3.10,team-ios,triaged-ios
low
Critical
323,582,003
go
os: ambiguous documentation of type FileMode
### What version of Go are you using (`go version`)? N/A ### Does this issue reproduce with the latest release? Yes ( [latest document online](https://golang.org/pkg/os/#FileMode) ) ### What operating system and processor architecture are you using (`go env`)? N/A ### What did you do? Read [documentation of the FileMode bitfields](https://golang.org/pkg/os/#FileMode) ### What did you expect to see? Either - *...The values of **the lowest 9 bits** should be considered part of the public API...* OR - *...The values of **any of the 32 bits already defined in the `const` listing below** should be considered part of the public API...* ### What did you see instead? - *...The values of **these** bits should be considered part of the public API...* The documentation as currently written is clearly open to interpretation. Further discussion: https://botbot.me/freenode/go-nuts/2018-05-16/?msg=100120706&page=5
Documentation,help wanted,NeedsFix
medium
Major
323,587,722
TypeScript
Support `export { x as default }` in namespace declarations
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section. --> ## Search Terms <!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily --> ## Suggestion <!-- A summary of what you'd like to see added or changed --> options for allow use import { xxx } from 'yyy'; when TS2497 resolves to a non-module entity without warn or use `// @ts-ignore` ```ts Error:(11, 19) TS2305: Module has no exported member 'isGitRoot'. Error:(11, 36) TS2497: Module resolves to a non-module entity and cannot be imported using this construct. ``` ## Use Cases <!-- What do you want to use this for? What shortcomings exist with current approaches? --> ## Examples <!-- Show how this would be used and what the behavior would be --> demo.ts ```ts import gitRoot, { isGitRoot } from 'git-root2'; ``` [git-root2](https://github.com/bluelovers/git-root2/blob/9e80cb80547d1aab01b19235f161852e198a8fe4/index.ts#L25-L52) ```ts declare function gitRoot(cwd?: string): string; declare namespace gitRoot { function isGitRoot(target: string): boolean; function async(cwd?: string): Promise<string>; } declare const _default: typeof gitRoot & { gitRoot(cwd?: string): string; default(cwd?: string): string; async(cwd?: string): Promise<string>; }; export = _default; ``` ## Checklist My suggestion meets these guidelines: [x] This wouldn't be a breaking change in existing TypeScript / JavaScript code [x] This wouldn't change the runtime behavior of existing JavaScript code [ ] This could be implemented without emitting different JS based on the types of the expressions [ ] This isn't a runtime feature (e.g. new expression-level syntax)
Suggestion,In Discussion
low
Critical
323,621,511
pytorch
[Caffe2] modify op in the net from init and predict files
I have a trained model stored as init.pb and predict.pb files. I load them successfully and print predict. one of the operations appears to be: ``` op { input: "300" input: "298" output: "301" name: "" type: "Add" arg { name: "broadcast" i: 1 } } ``` I would like to change the model so that the broadcast will be disabled, since it isn't supported by snpe and my tensors have the same shape anyway. Can you please advice how do I do this? Thanks!
caffe2
low
Minor
323,664,888
angular
Animations - child element triggers not performing easing
<!-- PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION. ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION. --> ## I'm submitting a... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (a behavior that used to work and stopped working in a new release) [x ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question [ ] Other... Please describe: </code></pre> ## Current behavior <!-- Describe how the issue manifests. --> Given an `<a>` with a `slide` trigger, transition appropriately performs easing. However, a `<span>` inside of the `<a>` with a `reveal` trigger performs no easing at all. It simply transitions between style states. ## Expected behavior <!-- Describe what the desired behavior would be. --> Transitions between styling in the `reveal` trigger should be animated with the easing specified in the `transition` function. ## Minimal reproduction of the problem with instructions <!-- For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via https://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter). --> ``` html <a mat-list-item [routerLink]="link" routerLinkActive="active" [@slide]="state" [matTooltip]="label" [matTooltipPosition]="tooltipPosition" [matTooltipDisabled]="state !== 'thin'"> <mat-icon>{{icon}}</mat-icon> <span [@reveal]="state">{{label}}</span> </a> ``` ``` ts animations: [ trigger( 'slide', [ state('collapse', style({ width: 0, opacity: 0, })), state('thin', style({ width: '*', opacity: 1 })), state('full', style({ width: '*', opacity: 1 })), transition('collapse => thin', animate('100ms ease-out')), transition('full => collapse', animate('100ms ease-in')) ] ), trigger( 'reveal', [ state('collapse', style({ width: 0, opacity: 0, 'margin-left': 0, 'margin-right': 0 })), state('thin', style({ width: 0, opacity: 0, 'margin-left': 0, 'margin-right': 0 })), state('full', style({ width: '*', opacity: 1, 'margin-left': '15px', 'margin-right': '10px' })), transition('thin => full', animate('100ms ease-out')), transition('full => collapse', animate('100ms ease-in')) ] ) ] ``` [Example Stackblitz](https://stackblitz.com/edit/child-trigger-easing-broken?file=app%2Fcomponents%2Fsidepanel%2Fpanel-link.component.ts) [Example Stackblitz](https://stackblitz.com/edit/transition-easing-issues?file=app%2Fcomponents%2Fsidepanel%2Fpanel-link.component.css) showing using CSS transitions to accomplish what the above should look like. ## What is the motivation / use case for changing the behavior? <!-- Describe the motivation or the concrete use case. --> Should be able to use angular animations without resorting to CSS transitions directly. ## Environment <pre><code> Angular version: 6.0.1 <!-- Check whether this is still an issue in the most recent Angular version --> Browser: - [x ] Chrome (desktop) version XX - [ ] Chrome (Android) version XX - [ ] Chrome (iOS) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [ ] Safari (iOS) version XX - [ ] IE version XX - [ ] Edge version XX
type: bug/fix,area: animations,freq2: medium,P3
low
Critical
323,671,328
go
cmd/compile: revisit statement boundaries CL peformance and binary size impact
Volunteer (and often reluctant) toolspeed cop here. (Sorry, @dr2chase.) [CL 102435](https://go-review.googlesource.com/102435) has a non-trivial impact on compilation speed, memory usage, and binary size: ``` name old time/op new time/op delta Template 176ms ± 2% 181ms ± 3% +2.61% (p=0.000 n=45+50) Unicode 87.5ms ± 5% 87.9ms ± 4% ~ (p=0.147 n=48+49) GoTypes 557ms ± 4% 569ms ± 2% +2.18% (p=0.000 n=42+44) Compiler 2.65s ± 3% 2.70s ± 3% +1.82% (p=0.000 n=49+49) SSA 7.16s ± 2% 7.37s ± 2% +3.00% (p=0.000 n=48+47) Flate 118ms ± 2% 123ms ± 3% +4.05% (p=0.000 n=48+49) GoParser 138ms ± 3% 143ms ± 2% +3.28% (p=0.000 n=49+47) Reflect 360ms ± 3% 367ms ± 3% +1.76% (p=0.000 n=48+48) Tar 157ms ± 4% 160ms ± 3% +2.31% (p=0.000 n=50+49) XML 201ms ± 4% 207ms ± 3% +2.79% (p=0.000 n=48+49) [Geo mean] 353ms 362ms +2.42% name old user-time/op new user-time/op delta Template 215ms ± 3% 219ms ± 3% +1.67% (p=0.000 n=48+49) Unicode 110ms ± 5% 110ms ± 3% ~ (p=0.051 n=48+46) GoTypes 741ms ± 4% 749ms ± 3% +1.05% (p=0.000 n=47+46) Compiler 3.60s ± 4% 3.63s ± 2% +0.84% (p=0.002 n=44+49) SSA 10.3s ± 4% 10.5s ± 2% +2.13% (p=0.000 n=44+46) Flate 138ms ± 3% 143ms ± 3% +3.28% (p=0.000 n=48+46) GoParser 159ms ± 3% 175ms ± 4% +9.82% (p=0.000 n=50+47) Reflect 464ms ± 2% 466ms ± 3% +0.47% (p=0.020 n=47+49) Tar 195ms ± 4% 198ms ± 3% +1.40% (p=0.000 n=50+46) XML 241ms ± 9% 258ms ± 3% +7.04% (p=0.000 n=50+48) [Geo mean] 446ms 458ms +2.79% name old alloc/op new alloc/op delta Template 35.1MB ± 0% 36.8MB ± 0% +4.91% (p=0.008 n=5+5) Unicode 29.3MB ± 0% 29.8MB ± 0% +1.59% (p=0.008 n=5+5) GoTypes 115MB ± 0% 121MB ± 0% +5.15% (p=0.008 n=5+5) Compiler 521MB ± 0% 560MB ± 0% +7.48% (p=0.008 n=5+5) SSA 1.71GB ± 0% 1.91GB ± 0% +11.69% (p=0.008 n=5+5) Flate 24.2MB ± 0% 25.4MB ± 0% +4.91% (p=0.008 n=5+5) GoParser 28.1MB ± 0% 29.5MB ± 0% +4.87% (p=0.008 n=5+5) Reflect 78.7MB ± 0% 82.4MB ± 0% +4.65% (p=0.008 n=5+5) Tar 34.5MB ± 0% 36.1MB ± 0% +4.62% (p=0.008 n=5+5) XML 43.3MB ± 0% 45.5MB ± 0% +5.27% (p=0.008 n=5+5) [Geo mean] 78.1MB 82.4MB +5.48% name old allocs/op new allocs/op delta Template 328k ± 0% 336k ± 0% +2.59% (p=0.008 n=5+5) Unicode 336k ± 0% 338k ± 0% +0.37% (p=0.008 n=5+5) GoTypes 1.14M ± 0% 1.17M ± 0% +2.29% (p=0.008 n=5+5) Compiler 4.77M ± 0% 4.88M ± 0% +2.23% (p=0.008 n=5+5) SSA 13.7M ± 0% 14.0M ± 0% +2.49% (p=0.008 n=5+5) Flate 220k ± 0% 226k ± 0% +2.71% (p=0.008 n=5+5) GoParser 273k ± 0% 280k ± 0% +2.29% (p=0.008 n=5+5) Reflect 940k ± 0% 971k ± 0% +3.32% (p=0.008 n=5+5) Tar 321k ± 0% 330k ± 0% +2.65% (p=0.008 n=5+5) XML 383k ± 0% 390k ± 0% +1.94% (p=0.008 n=5+5) [Geo mean] 751k 768k +2.28% name old text-bytes new text-bytes delta HelloSize 672kB ± 0% 680kB ± 0% +1.22% (p=0.000 n=50+50) name old data-bytes new data-bytes delta HelloSize 134kB ± 0% 134kB ± 0% ~ (all equal) name old exe-bytes new exe-bytes delta HelloSize 1.43MB ± 0% 1.49MB ± 0% +4.00% (p=0.000 n=50+50) ``` Reading the CL description, I can't quite tell what the value is to the user that offsets that impact. I'd like to revisit whether the speed, memory impact, and binary size impacts can be mitigated at all before Go 1.11 is released, and I personally would like to understand better what benefits the CL brings. Also, as an aside, I am slightly concerned about this bit from the CL description: ``` The code in fuse.go that glued together the value slices of two blocks produced a result that depended on the former capacities (not lengths) of the two slices. This causes differences in the 386 bootstrap, and also can sometimes put values into an order that does a worse job of preserving statement boundaries when values are removed. ``` Value order should not matter, and cannot be relied upon. (And @randall77 has an old, outstanding CL to randomize Value order to enforce that.) And it is unclear whether the fuse.go changes need to be permanent or not. I have very little dedicated laptop time in the immediate future due to personal life stuff, but I wanted to flag this right away. I'll look carefully at the CL and the impact as soon as I can. cc @dr2chase @aclements @bradfitz
ToolSpeed,NeedsInvestigation
medium
Critical
323,727,267
pytorch
checkpoint(function, *args) should have the same requires_grad as function(*args)
## Issue description In principle, to my understanding, checkpoint(function, *args) should behave exactly the same during forwarding as function(*args). However, now, if the all the inputs have requires_grad to be False, the output will also checkpoint(...) will also have requires_grad to be False. While function may involve other trainable parameters, function(*args) will have requires_grad True output even all the inputs are requires_grad False. should be fixed if replacing the no_grad with `detach_variable(run_function(*args))` (although detach_variable doesn't accept non tuple right now) ## Code example ``` import torch from torch.utils.checkpoint import checkpoint m = torch.nn.Linear(4,3) x = torch.randn(10,4) z1 = checkpoint(lambda _:m(_), x) print(z1.requires_grad) z2 = m(x) print(z2.requires_grad) ``` ## System Info PyTorch version: 0.5.0a0+a61d4a3 Is debug build: No CUDA used to build PyTorch: None OS: Mac OSX 10.13.1 GCC version: Could not collect CMake version: version 3.9.4 Python version: 2.7 Is CUDA available: No CUDA runtime version: No CUDA GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA Versions of relevant libraries: [pip] numpy (1.14.2) [pip] torch (0.5.0a0+a61d4a3, /Users/ruotianluo/anaconda/lib/python2.7/site-packages) [pip] torchvision (0.2.0) [conda] torch 0.5.0a0+242f6c3 <pip> [conda] torch 0.5.0a0+a61d4a3 <pip> [conda] torch 0.4.0a0+dd91d57 <pip> [conda] torch 0.4.0a0+4a9e02f <pip> [conda] torch 0.4.0a0+460e8cd <pip> [conda] torch 0.4.0a0+4dd29ac <pip> [conda] torchvision 0.2.0 <pip> cc @ezyang @SsnL @albanD @zou3519 @gqchen
module: checkpoint,module: autograd,triaged
medium
Critical
323,766,630
go
cmd/gofmt: better error message when gofmt is out of date
It's not uncommon to run an old gofmt that may not be up-to-date with the latest syntactic changes (most recently, alias type declarations). There may be future (Go 2) changes where this becomes more acute. When gofmt reports a syntax error, we may want to compare the gofmt (build time) version with the current "go version" and possibly report significant version discrepancies with the error ("please update gofmt"). Reminder issue to look into this.
NeedsInvestigation
low
Critical
323,776,755
neovim
TUI + guicursor : artifacts on mode-change
<!-- Before reporting: search existing issues and check the FAQ. --> - `nvim --version`: ``` NVIM v0.2.3-856-g0848add48 Build type: Release LuaJIT 2.0.5 Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20180318-33096-1djfgu9/build/config -I/tmp/neovim-20180318-33096-1djfgu9/src -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180318-33096-1djfgu9/build/src/nvim/auto -I/tmp/neovim-20180318-33096-1djfgu9/build/include Compiled by vheon@spark Features: +acl +iconv +jemalloc +tui See ":help feature-compile" system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-0848add_1/share/nvim" Run :checkhealth for more info ``` - Vim (version: ) behaves differently? - Operating system/version: OSX 10.11.6 - Terminal name/version: iTerm2 3.1.6 - `$TERM`: xterm-256color Sorry I could not find a better title. I've trimmed my configuration to a minimal reproducible test case where having gruvbox setted as my colorscheme with the `guicursor` setted as in the `testinit.vim` file I get `f`s whenever I go from one mode to another. It looks like the culprit is actually that specific value of `guicursor` because for example having `set guicursor=v:block-Search,i:block-CtrlPMode2` does not trigger this. ### Steps to reproduce using `nvim -u testinit.vim` ```viml call plug#begin('/Users/vheon/.vim/bundle') Plug 'morhetz/gruvbox' call plug#end() set termguicolors colorscheme gruvbox set guicursor=n:block-lCursor ``` ``` nvim -u testinit.vim :<esc> ``` or ``` nvim -u testinit.vim V<Esc> ``` ### Actual behaviour ![screen shot 2018-05-16 at 22 20 57](https://user-images.githubusercontent.com/90633/40142190-45d6f35e-5958-11e8-88e0-ece5e4950f50.png) ![screen shot 2018-05-16 at 22 30 23](https://user-images.githubusercontent.com/90633/40142432-d9290584-5958-11e8-87f9-26f617508847.png)
bug,tui,display
low
Critical
323,791,051
flutter
Scrollable.ensureVisible is not useful for items scrolled out of view.
Internal: b/292548523 When a context is thrown out, it's not possible to ensure that it's visible. To reproduce in the Flutter Gallery: https://github.com/flutter/flutter/compare/master...DaveShuckerow:ensure-visible?expand=1 It would be helpful to have APIs for scrolling a Scrollable in the direction of something even if the context isn't available, as well as to easily check if a widget inside of a scrollable is visible.
c: new feature,framework,f: scrolling,customer: mulligan (g3),P2,team-framework,triaged-framework
low
Major
323,820,956
opencv
imreadmulti cannot read 32-bit
##### System information (version) - OpenCV => 3.1 - Operating System / Platform => Windows 64 Bit - Compiler => Visual Studio 2017 and - Operating System / Platform => ubuntu 16.4 - Compiler => gcc-7 ##### Detailed description 32-bit image stacks which include several slices but can only be identified as 1 slice. I attached my project on both Windows and Ubuntu here. There are four images in the attached documents, watershed_solid-8bit(5 slices), test-RGB(3 slices) work well. However, watershed_solid-32bit(5 slices) and test-32-bit (3 slices) only be recognized as 1 slice. ##### Steps to reproduce ```.cpp #include <iostream> #include <vector> #include <fstream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main(int argc, char **argv) { std::vector<cv::Mat> image; /*bool successful = cv::imreadmulti("watershed_solid-32bit.raw", image, cv::IMREAD_ANYDEPTH);*/ bool successful = cv::imreadmulti("test-32-bit.tif", image, cv::IMREAD_ANYDEPTH); cout << "image's size is " << image.front().rows << 'x' << image.front().cols << 'x' << image.size() << endl; cout << "the size of vector image is " << image.size() << endl; system("pause"); return 0; } ``` Project attached here https://drive.google.com/open?id=1Ix04XV3ye0UGLGx9OCVap_esRPPhcHow
priority: low,category: imgcodecs
low
Minor
323,910,392
neovim
call sync() on CursorHold
https://github.com/neovim/neovim/pull/8304 changed `nofsync` to be somewhat more robust, in particular swapfiles are fsync'd on CursorHold. But we could also call [sync()](https://en.wikipedia.org/wiki/Sync_(Unix)) on CursorHold, to reduce dependence on swapfiles. However a small but probably worthwhile optimization would be to only do this if a buffer was written. Need a flag or something like that. - Additional (low-risk) improvement: modify [updatescript()](https://github.com/neovim/neovim/pull/8304/files#diff-1c25b3c9884177e3e12380a2ced7d51bR1354) so that `++count >= p_uc` does _not_ trigger unless 'updatetime' (*non*-idle) has elapsed. - Rationale: scripted or _batch_ input is not an important data-loss risk in the event of an abrupt OS failure. --- see also - https://github.com/vim/vim/issues/8879
enhancement,performance,robustness,io,system
low
Critical
323,915,539
rust
"#[derive] can't be used on a non-Copy #[repr(packed)] struct" but struct is Copy
Reported by @retep998 at https://github.com/rust-lang/rust/issues/46043#issuecomment-389696974, here's a minimal example: ```rust #[repr(packed)] #[derive(Debug)] struct Foo { x: usize, } impl Clone for Foo { fn clone(&self) -> Self { Foo { x: self.x } } } impl Copy for Foo {} ``` [play](https://play.rust-lang.org/?gist=ec60a3f40eaf5cc5f57dd4b206b15fba&version=stable&mode=debug)
C-bug,A-repr-packed
low
Critical
323,954,543
go
x/cmd/gotype: undeclared name: _Ctype_struct_bpf_program
Cgo struct types of the form `_Ctype_struct_` seems to be unknown to `gotype`. ### What version of Go are you using (`go version`)? go version go1.10.2 linux/amd64 ### Does this issue reproduce with the latest release? Yes ### What operating system and processor architecture are you using (`go env`)? GOARCH="amd64" GOOS="linux" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" ### What did you do? Lint using `gotype` a dummy package which imports `github.com/google/gopacket/pcap`. `$ go get -u github.com/google/gopacket/pcap` ``` $ cat $GOPATH/src/github.com/google/dummy/dummy.go package dummy import _ "github.com/google/gopacket/pcap" ``` `$ gotype dummy.go` ### What did you expect to see? No output (as in everything is OK). ### What did you see instead? ``` dummy.go:2:10: could not import github.com/google/gopacket/pcap (type-checking package "github.com/google/gopacket/pcap" failed ($GOPATH/src/github.com/google/gopacket/pcap/pcap.go:533:49: undeclared name: _Ctype_struct_bpf_program)) ``` Running `gotype` on `github.com/google/gopacket/pcap` directly gives: ``` $ gotype pcap.go pcap.go:533:49: undeclared name: _Ctype_struct_bpf_program pcap.go:203:7: undeclared name: _Ctype_struct_bpf_program pcap.go:661:66: undeclared name: _Ctype_struct_bpf_program pcap.go:801:34: undeclared name: _Ctype_struct_pcap_addr pcap.go:401:17: invalid operation: p.pkthdr (variable of type *invalid type) has no field or method ts pcap.go:403:19: invalid operation: p.pkthdr (variable of type *invalid type) has no field or method ts pcap.go:406:27: invalid operation: p.pkthdr (variable of type *invalid type) has no field or method caplen pcap.go:407:20: invalid operation: p.pkthdr (variable of type *invalid type) has no field or method len pcap.go:425:4: invalid operation: p (variable of type *Handle) has no field or method waitForPacket pcap.go:488:13: undeclared name: _Ctype_struct_pcap_stat ```
NeedsInvestigation
low
Critical
324,034,970
vscode
Feature request: Allow Code Outline in Minimap location
I'm using the VS Code insiders build, which has Code Outline built in. I loved this feature from Nuclide, but in its current incarnation it's not as useful as it could be (to me). I have to choose now between file tree (or git or any other of course) sidebar and Code Outline, but I'd prefer to always have it next to my code. My idea was to allow what is now the Minimap to use different "widgets" (sorry, I've never developed for VS Code so I don't know the correct terminology), so the Code Outline view could live there instead of the (minimally useful Minimap).
feature-request,outline
medium
Critical
324,090,250
go
brand: presentation theme: awkward overlap on Quote slide
In the second Quote slide of the Go presentation theme (https://golang.org/s/presentation-theme#slide=id.g33148270ac_0_439), the name at the bottom often just barely clips the top of the jellyfish picture (see the letter ‘R’ in the screenshot below). None of the rest of the text on that slide clips into the pictures, so that one incursion is distracting, and the lower contrast between the text and the jellyfish can make that part of the text more difficult to read. (CC: @spf13) <img src="https://user-images.githubusercontent.com/5200974/40189006-4cb5ac1c-59c9-11e8-8566-072685b2e91f.png" width=300px alt="text overlapping jellyfish">
NeedsInvestigation
low
Minor
324,102,417
go
html/template: does not recognize rgb() as a CSS color
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? tip ### Does this issue reproduce with the latest release? yes ### What operating system and processor architecture are you using (`go env`)? does not matter ### What did you do? An code fragment to reproduced is here: https://play.golang.org/p/r8LOFN_roBo Using `string` instead of `template.HTML` produces the same result. ### What did you expect to see? `color: rgb(10,20,30)` ### What did you see instead? `color: ZgotmplZ`
help wanted,NeedsInvestigation
low
Major
324,133,442
rust
Warn and eventually forbid transmute::<T, U> for T or U with unspecified (Rust) layout
It is a fairly commonplace mistake to do a `transmute::<T, U>` for `T` and `U` which are not necessarily compatible, but happen to work at that some particular point in time. These transmutes either change in behaviour when the compiler is updated or stop compiling altogether (because the size of T and size of U are not the same anymore (see e.g. https://github.com/rust-lang/rust/issues/50830)). The same way we error for mismatching sizes, we can also raise such an error (possibly disable-able by a `#[feature(very_fast_such_dangerous)]`) for types for which sizes may change over time with future compiler releases. Namely, this would prevent using `transmute` on stable for anything that 1. Does not have one of the whitelisted `#[repr()]` attribute on top of the type declaration; 2. Is not a FFI-safe type in the first place. If we did that already, the issue linked before would’ve failed, because none of the enums have a `#[repr]` attribute on top of them, making their layout unspecified and therefore not transmutable.
A-lints,T-compiler,C-feature-request
medium
Critical
324,163,074
TypeScript
Revise whitespace handling in JSDoc
Ref #24184 Our JSDoc scanner currently always scans whitespace and newlines as significant - the constant need to skip or ignore these tokens, then fix up node positions to account for them (or ignore them) is a brittle process - especially as the jsdoc scanner is interwoven with the normal scanner for certain parts of jsdoc parsing, which _does_ make whitespace insignificant. The JSDoc scanner should behave more like the normal scanner or JSX scanner where whitespace is insignificant (and never has a token made for it), and comment text has an alternate scan mode that munches on all text until something indicates the comment's end (for capturing descriptions). AFAIK, whitespace is captured as a token right now to capture indentation for descriptions; however description start position and the raw text of the description should be sufficient to derive the re-indented value. Descriptions should _probably_ be nodes, like `JSXText`, with a range and a processed value (kinda like an identifier or a literal) - this way the original source text remains available via the range, but also have a processed `value` that's has spare blank lines and indentation stripped away (this would help the classifier quite a bit, as it relies on a bunch of implicit structure in the JSDoc parser and AST to capture them today).
Bug
low
Minor
324,187,566
flutter
Updated AppBar action button during validate callback in TextFormField
Internal: b/292548353 Requirement: When `TextFormField` validate callback detects an error, update the AppBar in the Scaffold to disable an action button. I was trying to call setState in the validate callback to trigger another widget.build() call. Unfortunately I get "setState() or `markNeedsBuild()` called during build." error. What is the correct way to do this behavior. I am doing a work around by attaching an onChange callback inside a Form widget that wraps the `TextFormField`. Call validate() on the `TextFormField`'s FormState and setState that way. Since Form is not required for `TextFormField`, this doesn't seem like the correct way of doing this.
a: text input,framework,customer: mulligan (g3),has reproducible steps,P2,found in release: 3.3,found in release: 3.5,team-framework,triaged-framework,fyi-text-input
low
Critical
324,202,952
TypeScript
Cannot create declaration files from static factory class returned from a function.
**TypeScript Version:** 2.8 and 2.9 <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** Cannot create declaration files from static factory class returned from a function. **Code** (pay special attention to `class SomeClass`) ```ts namespace Test { export interface IType<TInstance = object> { new(...args: any[]): TInstance; } export function ClassFactory<TBaseClass extends IType, TClass extends any, TFactory extends any, TNamespace extends object> (namespace: TNamespace, base: { $__type: TBaseClass }, getType: (base: TBaseClass) => [TClass, TFactory], exportName?: keyof TNamespace, addMemberTypeInfo = true) : TClass & TFactory & { $__type: TClass } { return null; } export function FactoryBase<TBaseFactory extends IType>(baseFactoryType: TBaseFactory) { return class FactoryBase { static 'new'?(...args: any[]): any; static init?(o: object, isnew: boolean, ...args: any[]): void; }; } function TestDec<T>(c:T):T { return null; } export namespace Loader { export var _SomeClass = ClassFactory(Loader, void 0, (base) => { @TestDec class SomeClass { static readonly SomeClassFactory = class Factory extends FactoryBase(null) { static 'new'(): SomeClass { return null; } static init(o: SomeClass, isnew: boolean) { } }; } return [SomeClass, SomeClass["SomeClassFactory"]]; } ); } } ``` The code compiles and runs OK, no problems. The issue is that when I enable the flag to export declarations as well I get this error: > Scripts/testscript.ts(20,20): error TS4025: Exported variable '_SomeClass' has or is using private name 'SomeClass'. **Expected behavior:** It is expected that the `d.ts` files are generated without giving me issues. Without declarations it compiles fine. The partial workaround (see below) makes the error pointless. **Actual behavior:** Error message (see above). **Other Details:** This works: ```ts namespace Test { export interface IType<TInstance = object> { new(...args: any[]): TInstance; } export function ClassFactory<TBaseClass extends IType, TClass extends any, TFactory extends any, TNamespace extends object> (namespace: TNamespace, base: { $__type: TBaseClass }, getType: (base: TBaseClass) => [TClass, TFactory], exportName?: keyof TNamespace, addMemberTypeInfo = true) : TClass & TFactory & { $__type: TClass } { return null; } export function FactoryBase<TBaseFactory extends IType>(baseFactoryType: TBaseFactory) { return class FactoryBase { static 'new'?(...args: any[]): any; static init?(o: object, isnew: boolean, ...args: any[]): void; }; } function TestDec<T>(c:T):T { return null; } export namespace Loader { export var _SomeClass = ClassFactory(Loader, void 0, (base) => { // @TestDec <- CANNOT ADD DECORATORS, CANNOT SUPPORT ANGULAR, ETC., WITHOUT UGLY WORKAROUNDS var c = class SomeClass { static readonly SomeClassFactory = class Factory extends FactoryBase(null) { static 'new'(): SomeClass { return null; } static init(o: SomeClass, isnew: boolean) { } }; }; return [c, c["SomeClassFactory"]]; } ); } } ``` Notice however that I lost the `@TestDec` decorator doing this above (YES, I know a decorator is just a function). Not a very pleasant experience for Angular users. Now, the following code I change `SomeClassFactory` to `protected` and it works ONLY if declarations are turned off; HOWEVER, when declarations are turned are on, this also fails with error: `testscript.ts(22,20): error TS4094: Property 'SomeClassFactory' of exported class expression may not be private or protected.` It's protected for a reason - I do not want people to see it in the code completion list on the exported property. ``` namespace Test { export interface IType<TInstance = object> { new(...args: any[]): TInstance; } export function ClassFactory<TBaseClass extends IType, TClass extends any, TFactory extends any, TNamespace extends object> (namespace: TNamespace, base: { $__type: TBaseClass }, getType: (base: TBaseClass) => [TClass, TFactory], exportName?: keyof TNamespace, addMemberTypeInfo = true) : TClass & TFactory & { $__type: TClass } { return null; } export function FactoryBase<TBaseFactory extends IType>(baseFactoryType: TBaseFactory) { return class FactoryBase { static 'new'?(...args: any[]): any; static init?(o: object, isnew: boolean, ...args: any[]): void; }; } function TestDec<T>(c:T):T { return null; } export namespace Loader { export var _SomeClass = ClassFactory(Loader, void 0, (base) => { // @TestDec <- CANNOT ADD DECORATORS, CANNOT SUPPORT ANGULAR, ETC., WITHOUT UGLY WORKAROUNDS var c = class SomeClass { protected static readonly SomeClassFactory = class Factory extends FactoryBase(null) { static 'new'(): SomeClass { return null; } static init(o: SomeClass, isnew: boolean) { } }; }; return [c, c["SomeClassFactory"]]; } ); } } ``` It's very frustrating to have it compile and run PERFECTLY, but then fail to generate declaration files. I keep getting blocked at every turn and it's driving me nuts lol. It's days like this I just want to switch back to pure JavaScript and save time (except then I realize all the bugs I'll probably get which would offset any time saved coding it lol ... :*( ).
Bug
low
Critical