compiler-options

Typescript configuration: is module setting case sensitive?

落花浮王杯 提交于 2021-01-29 14:27:55
问题 I've got a question coming from the following two tsconfig.json files, they're in the same project, one extends the other: Parent { "compilerOptions": { "experimentalDecorators": true, "skipLibCheck": true, "module": "ESNext" } // ... Child { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", "module": "esNext", }, // ... } It's unclear: is the module param case sensitive? a setup like this, with a child config extending the parent, same module type, but with

Angular 6 / declare path for library in tsconfig.lib.json

笑着哭i 提交于 2020-05-15 02:16:08
问题 I'm trying to configure the paths for an Angular 6 library (I have successfully configured the paths for a previous Angular project) Here is what is working for my previous app in the tsconfig.json file: "compilerOptions": { [...] "baseUrl": "src", "paths": { "@class/*": [ "app/class/*" ], "@services/*": [ "app/services/*" ], "@views/*": [ "app/views/*" ] } } and then use it like for example: Import { Item } form '@class/item'; In my new app I'm trying the same way in the tsconfig.**lib**

What is the benefit of using '--strictFunctionTypes' in Typescript?

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-21 10:56:02
问题 As I understand it, --strictFunctionTypes compiler option in Typescript prevents a very common use case of polymorphism from working: type Handler = (request: Request) => Response const myHandler: Handler = (request: Request & { extraArg: boolean }) => { return !!request.extraArg } Generally, I assume that all compiler options in the strict family have some great benefits, but in this case, all I see is that it prevents a very logical behavior from working. So what are the cases where this

What is the benefit of using '--strictFunctionTypes' in Typescript?

有些话、适合烂在心里 提交于 2020-02-21 10:55:54
问题 As I understand it, --strictFunctionTypes compiler option in Typescript prevents a very common use case of polymorphism from working: type Handler = (request: Request) => Response const myHandler: Handler = (request: Request & { extraArg: boolean }) => { return !!request.extraArg } Generally, I assume that all compiler options in the strict family have some great benefits, but in this case, all I see is that it prevents a very logical behavior from working. So what are the cases where this

What is the benefit of using '--strictFunctionTypes' in Typescript?

有些话、适合烂在心里 提交于 2020-02-21 10:55:06
问题 As I understand it, --strictFunctionTypes compiler option in Typescript prevents a very common use case of polymorphism from working: type Handler = (request: Request) => Response const myHandler: Handler = (request: Request & { extraArg: boolean }) => { return !!request.extraArg } Generally, I assume that all compiler options in the strict family have some great benefits, but in this case, all I see is that it prevents a very logical behavior from working. So what are the cases where this

Is there a way to obtain elided lifetime parameters from the Rust compiler?

依然范特西╮ 提交于 2020-02-04 02:40:53
问题 Given a Rust program, which compiles correctly, can I get the compiler to tell me what the elided lifetimes were inferred to be? 回答1: The cases where the compiler (currently 1 ) can allow elided lifetimes are actually so simple that there isn't much the compiler could tell you about what it inferred: Given a function, all elided lifetimes have the same value. The compiler doesn't accept elided lifetimes in cases where it would have a choice to make. The exception is in methods, but tying all

How to set compiler options in VS Code and/or .NET Core?

你。 提交于 2020-01-30 03:32:30
问题 I'm trying to set the -checked compiler option for a C# library project written over .NET Core, using VS Code as the IDE. How can I do this? 回答1: When you open your project/solution with VS Code, it will create a directory called .vscode , within it there will be a tasks.json file (this directory and file are created the first time that you hit F5 within VS Code) Taking a look at this file, you'll that it takes a format similar to the following: { "version": "2.0.0", "tasks": [ { "label":

How to disable compiler optimizations in gcc?

感情迁移 提交于 2020-01-09 08:27:28
问题 I am trying to learn assembly language. I have searched and found how to disassemble a .c file but I think it produces some optimized version of the program. Is there any way so that I can see the exact assembly code which corresponds to my C file. 回答1: The gcc option -O enables different levels of optimization. Use -O0 to disable them and use -S to output assembly. -O3 is the highest level of optimization. Starting with gcc 4.8 the optimization level -Og is available. It enables

Visual C++ Compiler Optimization Flags: Difference Between /O2 and /Ot

送分小仙女□ 提交于 2020-01-02 02:53:08
问题 What's the difference between the /Ot flag ("favor fast code") and the /O2 flag ("maximize speed")? (Ditto with /Os and /O1 .) 回答1: /O1 and /O2 bundle together a number of options aimed at a larger goal. So /O1 makes a number of code generation choices that favour size; /O2 does the same thing and favours speed. /O1 includes /Os as well as other options. /O2 includes /Ot as well as other options. Some optimisations are enabled by both /O1 and /O2. And, depending on your program's paging

Automated F# Signature File (.fsi) Generation

丶灬走出姿态 提交于 2020-01-01 04:54:35
问题 I am working on a project that has a number of modules that I'd like to apply access control constraints to. I'd also like to have my project contain additional documentation on the type signatures of each function. I know that I can accomplish both of these tasks very easily via F# signature files. However, my project is large and contains many files, and I need a convenient way of generating a signature file for each one. I have been successful in generating individual signature files via