Ticket #251 (new defect)
shared constructor wants to initialize instance variables of reference types
| Reported by: | nevdelap | Owned by: | |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | Cobra Compiler | Version: | 0.8.0 |
| Keywords: | Cc: |
Description
class A
var isntShared as String
cue init
base.init
.isntShared = '1'
shared
var isShared as String
cue init
.isShared = '2'
class P
def main is shared
assert A().isntShared == '1'
assert A.isShared == '2'
test.cobra(16): error: Cannot access instance member "isntShared" from the current shared member. Make the member "shared" or create an instance of the type.
If the strings are changed to a class the result is the same. If the strings are changed to int, or a struct it is ok.
Hopefully starting in October I will have time to start fixing bugs instead of just reporting them.
Change History
Note: See
TracTickets for help on using
tickets.



