Commit 898d3135 authored by Tom Niget's avatar Tom Niget

Disable dot for builtin promises

parent ae6126f2
...@@ -3,7 +3,7 @@ import ast ...@@ -3,7 +3,7 @@ import ast
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import List, Iterable from typing import List, Iterable
from transpiler.phases.typing.types import UserType, FunctionType from transpiler.phases.typing.types import UserType, FunctionType, Promise
from transpiler.phases.utils import make_lnd from transpiler.phases.utils import make_lnd
from transpiler.utils import compare_ast, linenodata from transpiler.utils import compare_ast, linenodata
from transpiler.consts import SYMBOLS, PRECEDENCE_LEVELS, DUNDER_SYMBOLS from transpiler.consts import SYMBOLS, PRECEDENCE_LEVELS, DUNDER_SYMBOLS
...@@ -212,7 +212,7 @@ class ExpressionVisitor(NodeVisitor): ...@@ -212,7 +212,7 @@ class ExpressionVisitor(NodeVisitor):
yield ")" yield ")"
def visit_Attribute(self, node: ast.Attribute) -> Iterable[str]: def visit_Attribute(self, node: ast.Attribute) -> Iterable[str]:
if isinstance(node.type, FunctionType): if isinstance(node.type, FunctionType) and not isinstance(node.value.type, Promise):
if node.value.type.resolve().is_reference: if node.value.type.resolve().is_reference:
yield "dotp" yield "dotp"
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment