Ticket #214 (new defect)

Opened 9 years ago

Last modified 6 years ago

Members use in preconditions on x mustn't be less visible than x.

Reported by: nevdelap Owned by:
Priority: medium Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:


My lame example covers just one case. lame is less visible than meth, and so should fail to compile.

{{{class A

var lame as int is private

cue init

lame = #[something secretly computed inside A]

def meth


lame == 1


print "hello"

class P

def main

a = A()

Change History

Changed 9 years ago by nevdelap

Damn. I meant to click Preview and now the lame somehow came out as underlines, and the I guess have to be on their own lines? Oh well.

Changed 6 years ago by Charles

This goes for post conditions as well.

Also, invariants shouldn't reference protected or private members.

Since we currently allow all of this, start with warnings. Make errors later.

Note: See TracTickets for help on using tickets.