Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions compiler/acton/test/typeerrors/init_try_finally_order.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Holder(object):
first: int
second: int
def __init__(self):
try:
self.first = self.second + 1
finally:
self.second = 2
20 changes: 20 additions & 0 deletions compiler/acton/test/typeerrors/init_try_finally_order.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Building file test/typeerrors/init_try_finally_order.act using temporary scratch directory
init_try_finally_order Parse done 0.000 s
[error Type error]: Attribute 'first' is not initialized in Holder.__init__
+--> init_try_finally_order.act@4:5-8:1
|
1 | class Holder(object):
: ^--------------------
: `- In class Holder
2 | first: int
: ^----
: `- Attribute 'first' is defined here
:
4 | +> def __init__(self):
5 | | try:
6 | | self.first = self.second + 1
7 | | finally:
8 | |> self.second = 2
: |
: `- Attribute 'first' is not initialized in __init__
-----+
Loading
Loading