Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tom Niget
typon
Commits
5f568116
Commit
5f568116
authored
Aug 11, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store type origin info for traceback display
parent
175ae7bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
trans/transpiler/phases/typing/expr.py
trans/transpiler/phases/typing/expr.py
+2
-0
trans/transpiler/phases/typing/types.py
trans/transpiler/phases/typing/types.py
+2
-0
No files found.
trans/transpiler/phases/typing/expr.py
View file @
5f568116
...
...
@@ -42,6 +42,8 @@ class ScoperExprVisitor(ScoperVisitor):
TB_SKIP
=
False
raise
NotImplementedError
(
f"`
{
ast
.
unparse
(
node
)
}
`
{
type
(
node
)
}
"
)
res
=
res
.
resolve
()
if
True
or
not
hasattr
(
res
,
"from_node"
):
res
.
from_node
=
node
node
.
type
=
res
return
res
...
...
trans/transpiler/phases/typing/types.py
View file @
5f568116
...
...
@@ -174,6 +174,8 @@ class TypeOperator(BaseType, ABC):
def
unify_internal
(
self
,
other
:
BaseType
):
from
transpiler.phases.typing.exceptions
import
TypeMismatchError
,
TypeMismatchKind
if
from_node
:
=
next
(
filter
(
None
,
(
getattr
(
x
,
"from_node"
,
None
)
for
x
in
(
other
,
self
))),
None
):
TB_NODE
=
from_node
if
not
isinstance
(
other
,
TypeOperator
):
raise
TypeMismatchError
(
self
,
other
,
TypeMismatchKind
.
DIFFERENT_TYPE
)
if
other
.
is_protocol
and
not
self
.
is_protocol
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment