Make recursive structures possible

This commit is contained in:
K35 2022-01-18 10:27:49 +00:00
parent bea91800d6
commit f3a2eb0fab
3 changed files with 3 additions and 3 deletions

View File

@ -9905,7 +9905,7 @@ function get_ir(parsed) {
throw new IRError(field, "Invalid statement!"); throw new IRError(field, "Invalid statement!");
} }
if (defined.indexOf(field.fieldtype) < 0) { if (defined.indexOf(field.fieldtype) < 0) {
if (builtin.indexOf(field.fieldtype) < 0) { if (builtin.indexOf(field.fieldtype) < 0 && field.fieldtype !== field.name) {
throw new IRError(field, `Type ${field.fieldtype} is not defined!`); throw new IRError(field, `Type ${field.fieldtype} is not defined!`);
} }
} else { } else {

View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/jrpcgen", "name": "@hibas123/jrpcgen",
"version": "1.0.24", "version": "1.0.25",
"main": "lib/index.js", "main": "lib/index.js",
"license": "MIT", "license": "MIT",
"packageManager": "yarn@3.1.1", "packageManager": "yarn@3.1.1",

View File

@ -101,7 +101,7 @@ export default function get_ir(parsed: Parsed): IR {
} }
if (defined.indexOf(field.fieldtype) < 0) { if (defined.indexOf(field.fieldtype) < 0) {
if (builtin.indexOf(field.fieldtype) < 0) { if (builtin.indexOf(field.fieldtype) < 0 && field.fieldtype !== field.name) {
throw new IRError( throw new IRError(
field, field,
`Type ${field.fieldtype} is not defined!` `Type ${field.fieldtype} is not defined!`