While working on mapped types (#157), I found the following
interface X {
a: 2,
A: 4,
b: 6
}
type UT<Type> = {
[Property in keyof Type as Capitalize<string & Property>]: Type[Property]
};
declare let x: UT<X>;
x.A
x.A: 2 | 4
This is difficult because Property contribution is set inside
The argument could be fixed via
CovariantContribution::CaseInsenstive
Which specialised to intrinsic TypeId::CASE_INSENSITIVE alias type (similar to existing intrinsics)
The actual lookup is a bit more complex
get_property_unbound with PropertyKey where it can be an or (or or-like through a big or) should collect possibles
Does this collect things correctly? Is some information lost and the parameter made bigger?
slice_matches should have a case insensitive boolean parameter?
Also
function x<T>(u: Uppercase<T>): T. x("hi"): CaseInsensitive<"hi">
While working on mapped types (#157), I found the following
x.A: 2 | 4
This is difficult because
Property
contribution is set insideThe argument could be fixed via
CovariantContribution::CaseInsenstive
TypeId::CASE_INSENSITIVE
alias type (similar to existing intrinsics)The actual lookup is a bit more complex
get_property_unbound
with PropertyKey where it can be anor
(oror-like
through a big or) should collect possiblesslice_matches
should have a case insensitive boolean parameter?Also
function x<T>(u: Uppercase<T>): T
.x("hi"): CaseInsensitive<"hi">