added type info to getaddr
This commit is contained in:
@@ -24,7 +24,7 @@ export interface Context {
|
|||||||
environment: Record<string, NamedEntity>;
|
environment: Record<string, NamedEntity>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAttr(ctx: Context, name: string, field: string) {
|
export function getAttr(ctx: Context, name: string, field: string): TypeUsage {
|
||||||
const struct = ctx.environment[name];
|
const struct = ctx.environment[name];
|
||||||
if (!struct || struct.namedEntity !== "NamedType") {
|
if (!struct || struct.namedEntity !== "NamedType") {
|
||||||
throw Error(`Unknown type ${name}`);
|
throw Error(`Unknown type ${name}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user