qdmr | GUI application for configuring and programming cheap DMR | Navigation library
kandi X-RAY | qdmr Summary
kandi X-RAY | qdmr Summary
qdmr is a graphical user interface (GUI) application that allows to program several types of DMR radios. To this end, it aims at being a more universal codeplug programming software (CPS) compared to the device and even revision specific CPSs provided by the manufacturers. The goal of this project is to provide a single, comfortable, well-documented and platform-independent CPS for several types of (mainly Chinese) DMR radios.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of qdmr
qdmr Key Features
qdmr Examples and Code Snippets
Community Discussions
Trending Discussions on qdmr
QUESTION
[Edit - concluding remark]: It has turned out that the question below was mainly the result of some suboptimal typings and normally you might not have such issues like I had in my program => now with this knowledge, my question does not seem to make too much sense any more (as others have already mentioned below).
Please have a look at the following TypeScript code snippet.
As B extends A
this c: 8
line is of course allowed.
How do I have to change the types of function f
to forbid others keys next to a
and b
?
ANSWER
Answered 2020-May-08 at 21:27The behavior is by design. TS is structural type language where type compatibility is based on subtypying, in other words every type which has all constraints will pass the rule. In your example type of the value has all fields needed, so 'a' and 'b', therefore everything is ok.
There is no reason you should not allow for such object to be passed, as additional fields inside should not make you a difference. Saying that you extend means saying you are allowed to have more fields in terms of composites like objects.
Additional if you want a subtype, but with exact fields the only type which matches your need will be unfortunately A
, so the function signature should be f(a: A)
.
And to be clear even with f(a: A)
you will be able to pass values with additional fields, only object literals will be validated strictly. Any assigned value with more fields can be used without compiler complain. And the reason I describe already.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install qdmr
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page