in lib/semantic.js [2851:2902]
itemType: same ? current : _basic('any')
};
}
if (ast.type === 'group') {
return this.getExprType(ast.expr, env);
}
if (isCompare(ast.type)) {
return _basic('boolean');
}
if (ast.type === 'and' || ast.type === 'or') {
return _basic('boolean');
}
if (ast.type === 'increment' || ast.type === 'decrement') {
return this.getExprType(ast.expr, env);
}
if (ast.type === 'add' || ast.type === 'subtract'
|| ast.type === 'div' || ast.type === 'multi') {
return this.getExprType(ast.right, env);
}
console.log(ast);
throw new Error('can not get type');
}
getInstanceType(id, env) {
const type = this.getVariableType(id, env);
if(!isBasicType(type.type) && type.type !== 'model') {
this.error('$type can only be used as basic type instacne call.', type);
}
if(type.type === 'array') {
return type.itemType;
}
if(type.type === 'map') {
return type.valueType;
}
if(type.type === 'entry') {
return type.valueType;
}
return type;
}
getType(t, extern) {
if (t.tag === Tag.TYPE && t.lexeme === 'object') {
return {