private IType getCompilingClass ( ) { if ( isIncludeAll ( ) ) { return _gsClass ; } IType type = GosuClassCompilingStack . getCurrentCompilingType ( ) ; if ( type != null ) { return type ; } ISymbolTable symTableCtx = CompiledGosuClassSymbolTable . getSymTableCtx ( ) ; ISymbol thisSymbol = symTableCtx . getThisSymbolFromStackOrMap ( ) ; if ( thisSymbol != null ) { IType thisSymbolType = thisSymbol . getType ( ) ; if ( thisSymbolType instanceof IGosuClassInternal ) { return thisSymbolType ; } } return ! _gsClass . isDeclarationsCompiled ( ) ? _gsClass : null ; }
We expose type info in a context sensitive manner . For instance we only expose private features from within the containing class . We can determine the context class from the current compiling class . The compiling class is obtained from either 1 ) the actual CompiledGosuClass stack the Gosu Class TypeLoader manages or 2 ) from the class itself if it s not compiled yet . Note the latter case happens only on the UI side when a class is being edited .