Wiki

Ticket #367 (closed enhancement: fixed)

Opened 10 years ago

Last modified 10 years ago

Relax class pass warning on partial classes

Reported by: hopscc Owned by:
Priority: minor Milestone:
Component: Cobra Compiler Version: 0.9.6
Keywords: Cc:

Description

Theres a warning on use of "pass" in a class that already has some box members
(CobraParser.cobra .classPass)
as in

class X is partial
        pass

where class X is already declared

class X
        def foo
                print 'foo.'

        def main is shared
                x = X()
                x.foo

It seems it might be worthwhile to relax this if the class is declared partial which would allow the specification of partial classes as placeholders for additional work (placeholder/reminder for new named methods and fields to be added later)

( This is what is being done in the compiler for some of the backends - classes to be filled out eventually but in interim the partial classes are entered with 'pass' as the only content..
Can see the result if you rebuild the compiler selfhosting (rebuild it with itself)
Get 142 warnings for

 warning: Encountered "pass" in a class that already has declared members.

An alternative option would be to introduce a 'todo' or 'tobeimplemented' keyword that could be placed in such classes (same as pass) to note such use as temp placeholders..

Attachments

src-fix.patch Download (0.5 KB) - added by hopscc 10 years ago.

Change History

Changed 10 years ago by hopscc

Changed 10 years ago by hopscc

heres a q-and-d patch (apply in the Source dir) to suppress the warning on partial classes.

Changed 10 years ago by Charles

Changed 10 years ago by Charles

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.