- Increase precedence of (Foo) { 1, 2 }

- Add `--enable-new-generics` to enable `Foo{int}` generic syntax.
This commit is contained in:
Christoffer Lerno
2025-02-18 00:07:09 +01:00
committed by Christoffer Lerno
parent c41d551ead
commit e77d1fb646
27 changed files with 139 additions and 73 deletions

View File

@@ -29,11 +29,11 @@ module std::sort::cs(<Type, KeyFn>);
def Counts = usz[256] @private;
def Ranges = usz[257] @private;
def Indexs = char[256] @private;
def ElementType = $typeof(Type{}[0]);
def ElementType = $typeof((Type){}[0]);
const bool NO_KEY_FN @private = types::is_same(KeyFn, EmptySlot);
const bool KEY_BY_VALUE @private = NO_KEY_FN ||| $assignable(Type{}[0], $typefrom(KeyFn.paramsof[0].type));
const bool LIST_HAS_REF @private = $defined(&Type{}[0]);
const bool KEY_BY_VALUE @private = NO_KEY_FN ||| $assignable((Type){}[0], $typefrom(KeyFn.paramsof[0].type));
const bool LIST_HAS_REF @private = $defined(&(Type){}[0]);
def KeyFnReturnType = $typefrom(KeyFn.returns) @if(!NO_KEY_FN);
def KeyFnReturnType = ElementType @if(NO_KEY_FN);