package com.dong.maxhap.demos

import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp

@Composable
internal fun FaultLogDemo() {
    Column(
        modifier = Modifier.fillMaxSize().padding(16.dp),
        verticalArrangement = Arrangement.spacedBy(16.dp)
    ) {

        // 1. 最简单的StackOverflow
        Button(
            onClick = {
                // 无限递归 - 栈溢出
                fun infinite(): Int = infinite() + 1
                infinite()  // 触发 StackOverflowError
            },

            ) {
            Text("触发Fault 1: 栈溢出", color = Color.White)
        }

    }

}