/**
 * Phase 2b: Null Safety Checker
 *
 * Validates use<T> lifetime safety to prevent dangling references.
 *
 * Key Rules:
 * - use<T> cannot outlive the owned reference (own<T> or share<T>)
 * - use<T> cannot be stored in fields (temporary only)
 * - use<T> cannot be returned from functions
 * - use<T> parameters are valid only within function scope
 *
 * Error Codes: GS401-GS499
 */
import { type IRModule } from '../ir/types.js';
/**
 * Diagnostic message for null safety violations
 */
export interface NullSafetyDiagnostic {
    code: string;
    message: string;
    severity: 'error' | 'warning';
    location: {
        file: string;
        line: number;
        column: number;
    };
}
/**
 * Null Safety Checker
 *
 * Ensures use<T> references cannot outlive their owned counterparts.
 * Only enforced in ownership mode (not GC mode).
 */
export declare class NullChecker {
    private diagnostics;
    private scopeStack;
    private memoryMode;
    constructor(memoryMode?: 'gc' | 'ownership');
    /**
     * Analyze a module for null safety violations
     *
     * In GC mode: Analysis is skipped (use<T> lifetime managed by GC)
     * In ownership mode: use<T> lifetime violations are errors
     */
    analyze(module: IRModule): NullSafetyDiagnostic[];
    /**
     * Check class fields for use<T> (GS401)
     */
    private checkClassFields;
    /**
     * Check interface properties for use<T> (GS401)
     */
    private checkInterfaceProperties;
    /**
     * Check function for use<T> violations
     */
    private checkFunction;
    /**
     * Check instruction for use<T> violations
     */
    private checkInstruction;
    /**
     * Check terminator for use<T> violations (GS403)
     */
    private checkTerminator;
    /**
     * Check statement for use<T> violations
     * @deprecated This method is for AST-level IR. Use checkInstruction for SSA-level IR.
     */
    private checkStatement;
    /**
     * Check expression for use<T> violations
     */
    private checkExpression;
    /**
     * Check return expression for use<T> variables (GS403)
     */
    private checkReturnExpression;
    /**
     * Check if a type has use<T> ownership
     */
    private hasUseOwnership;
    /**
     * Check if a type has owning semantics (own<T> or share<T>)
     */
    private hasOwningType;
    /**
     * Check if a variable is a use<T> reference
     */
    private isUseRef;
    /**
     * Push a new lifetime scope
     */
    private pushScope;
    /**
     * Pop the current lifetime scope
     */
    private popScope;
    /**
     * Get current scope
     */
    private currentScope;
    /**
     * Add an error diagnostic
     */
    private addError;
}
/**
 * Analyze a module for null safety violations
 *
 * @param module - The IR module to analyze
 * @param memoryMode - Memory management mode ('gc' or 'ownership')
 */
export declare function analyzeNullSafety(module: IRModule, memoryMode?: 'gc' | 'ownership'): NullSafetyDiagnostic[];
//# sourceMappingURL=null-checker.d.ts.map