Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exercise-type-checker, 发现bug #11

Open
Hercules11 opened this issue Dec 17, 2023 · 0 comments
Open

exercise-type-checker, 发现bug #11

Hercules11 opened this issue Dec 17, 2023 · 0 comments

Comments

@Hercules11
Copy link

Hercules11 commented Dec 17, 2023

exercize-type-checker/src/type-checker-entry3.js

function resolveType(targetType) {
	const tsTypeAnnotationMap = {
		TSStringKeyword: "string",
		TSNumberKeyword: "number",
	};
	switch (targetType.type) {
		case "TSTypeAnnotation":
            return tsTypeAnnotationMap[targetType.typeAnnotation.type]; // 失效了, 调试发现targetType对象没有TSTypeAnnotation属性
		case "NumberTypeAnnotation":
			return "number";
		case "StringTypeAnnotation":
			return "string";
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant