def value_from_ast(ast_node: ast.AST, ctx: Context, *, error_on_unrecognized: bool=True) -> Value:
    val = _Visitor(ctx).visit(ast_node)
    if (val is None):
        if error_on_unrecognized:
            ctx.show_error('Invalid type annotation', node=ast_node)
        return AnyValue(AnySource.error)
    return val
def value_from_ast(ast_node: ast.AST, ctx: Context, *, error_on_unrecognized: bool=True) -> Value:
    val = _Visitor(ctx).visit(ast_node)
    if (val is None):
        if error_on_unrecognized:
            ctx.show_error('Invalid type annotation', node=ast_node)
        return AnyValue(AnySource.error)
    return val