@shd101wyy/yo 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import { type Expr } from "../../expr";
2
2
  import type { Type } from "../../types/definitions";
3
3
  import type { FunctionGenerationContext } from "../functions/context";
4
4
  import { type CodeGenContext } from "../utils";
5
+ export declare function resolveSomeTypeParamType(valueArg: Expr, valueType: Type, context: CodeGenContext): Type;
5
6
  export declare function generateDropCodeForValue(valueCode: string, valueType: Type, context: CodeGenContext): string;
6
7
  export declare function generateDupCodeForValue(valueCode: string, valueType: Type, context: CodeGenContext): string;
7
8
  export declare function getDropFunctionForType(type: Type, context: CodeGenContext): string | undefined;
@@ -76,6 +76,12 @@ export interface EvaluatorContext {
76
76
  specializedReturnType: Type;
77
77
  originalFunction: FunctionValue;
78
78
  };
79
+ currentlySpecializingFunctionStack?: Array<{
80
+ originalFuncId: string;
81
+ specializedFuncId: string;
82
+ specializedReturnType: Type;
83
+ originalFunction: FunctionValue;
84
+ }>;
79
85
  docCommentLookup?: Map<string, string>;
80
86
  }
81
87
  export interface ArgValues {
@@ -2,10 +2,20 @@ import { type Environment } from "../env";
2
2
  import type { Token } from "../token";
3
3
  import type { DynType, FnTraitType, FutureTraitType, SomeType, TraitType, Type } from "../types/definitions";
4
4
  import type { EvaluatorContext } from "./context";
5
+ export declare function markConcreteImplBeingRegistered(typeId: string, traitId: string): void;
6
+ export declare function unmarkConcreteImplBeingRegistered(typeId: string, traitId: string): void;
5
7
  export declare function typeImplementsTrait({ targetType, traitType, env, }: {
6
8
  targetType: Type;
7
9
  traitType: TraitType;
8
10
  env: Environment;
11
+ }): {
12
+ implemented: boolean;
13
+ env: Environment;
14
+ };
15
+ export declare function typeImplementsTraitBool({ targetType, traitType, env, }: {
16
+ targetType: Type;
17
+ traitType: TraitType;
18
+ env: Environment;
9
19
  }): boolean;
10
20
  export declare function checkTypeImplementsSelfConstraints({ targetType, traitType, env, errorToken, }: {
11
21
  targetType: Type;
@@ -26,7 +36,7 @@ export declare function typeIsRuntimeOnly(type: Type, env: Environment): boolean
26
36
  export declare function typeImplementsFn(type: Type | undefined): type is (SomeType | DynType) & {
27
37
  isFn: true;
28
38
  };
29
- export declare function extractFnTraitFromType(type: Type): FnTraitType | undefined;
39
+ export declare function extractFnTraitFromType(type: Type, env?: Environment): FnTraitType | undefined;
30
40
  export declare function typeImplementsFuture(type: Type | undefined): type is (SomeType | DynType) & {
31
41
  isFuture: true;
32
42
  };
@@ -29,6 +29,7 @@ export interface GenericImpl {
29
29
  traitTypeArgExprs?: Expr[];
30
30
  traitFunctionParamNames?: string[];
31
31
  }
32
+ export declare function isConcreteImplBeingRegistered(receiverTypeId: string, traitTypeId: string): boolean;
32
33
  export declare function clearGenericImplsFromModule(modulePath: string): void;
33
34
  export declare function clearAllGlobalImplState(): void;
34
35
  export declare function findMatchingGenericImpl({ concreteType, traitType, env, }: {