Wiki

Ticket #318: fwd-ref.patch

File fwd-ref.patch, 1.2 KB (added by hopscc, 12 years ago)
  • Source/Members.cobra

     
    516516        """ 
    517517        t = .type 
    518518        if t, return t 
     519        if not .didBindImp  # called via a fwd reference, bindImp not yet run on it  
     520            return .compiler.passThroughType # placeholder 
    519521        else, throw FallThroughException('_type is nil. this=[this]') 
    520522 
    521523    pro type as IType? 
  • Tests/900-misc/010-internal-err-fwd.cobra

     
     1# failure : compiler internal error - forward ref to static field 
     2use System.IO 
     3use System.Collections 
     4use System.Collections.Generic 
     5use System 
     6 
     7namespace AnyNode 
     8    class Server 
     9        def main is shared 
     10            pass 
     11             
     12    class NetStream  
     13        var _bufferSize as int = Config.bufferSize 
     14             
     15    class Config 
     16        var bufferSize as int 
     17            is shared, readonly  
     18        var traceLogging as bool  
     19            is shared, readonly 
     20         
     21        cue init is shared 
     22            .bufferSize = 1024 
     23            .traceLogging = false 
     24