checker: fix nested struct reference type field initialized check. (fix: #15741) (#15752)

This commit is contained in:
shove 2022-09-15 12:59:31 +08:00 committed by GitHub
parent 5719344653
commit 8b962f8446
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 288 additions and 223 deletions

View file

@ -18,7 +18,7 @@ struct Point {
struct App {
mut:
tui &tui.Context = unsafe { 0 }
tui &tui.Context = unsafe { nil }
points []Point
color tui.Color = colors[0]
color_idx int

View file

@ -2,7 +2,7 @@ import term.ui as tui
struct App {
mut:
tui &tui.Context = unsafe { 0 }
tui &tui.Context = unsafe { nil }
}
fn event(e &tui.Event, x voidptr) {

View file

@ -19,11 +19,11 @@ const (
[heap]
struct App {
mut:
tui &ui.Context = unsafe { 0 }
tui &ui.Context = unsafe { nil }
mode Mode = Mode.menu
width int
height int
game &Game = unsafe { 0 }
game &Game = unsafe { nil }
dt f32
ticks i64
}
@ -191,7 +191,7 @@ fn (mut a App) draw_game() {
struct Player {
mut:
game &Game
game &Game = unsafe { nil }
pos Vec
racket_size int = 4
score int
@ -242,7 +242,7 @@ fn (mut b Ball) update(dt f32) {
[heap]
struct Game {
mut:
app &App = unsafe { 0 }
app &App = unsafe { nil }
players []Player
ball Ball
}

View file

@ -12,7 +12,7 @@ mut:
struct App {
mut:
tui &tui.Context = unsafe { 0 }
tui &tui.Context = unsafe { nil }
rects []Rect
cur_rect Rect
is_drag bool

View file

@ -90,7 +90,7 @@ const (
struct App {
mut:
ui &ui.Context = unsafe { 0 }
ui &ui.Context = unsafe { nil }
header_text []string
mouse_pos Point
msg string

View file

@ -57,8 +57,8 @@ pub:
struct App {
mut:
tui &tui.Context = unsafe { 0 }
ed &Buffer = unsafe { 0 }
tui &tui.Context = unsafe { nil }
ed &Buffer = unsafe { nil }
current_file int
files []string
status string

View file

@ -71,7 +71,7 @@ mut:
// snake representation
struct Snake {
mut:
app &App
app &App = unsafe { nil }
direction Orientation
body []BodyPart
velocity Vec = Vec{
@ -247,7 +247,7 @@ mut:
}
captured bool
color termui.Color = grey
app &App
app &App = unsafe { nil }
}
// randomize spawn the rat in a new spot within the playable field
@ -259,7 +259,7 @@ fn (mut r Rat) randomize() {
[heap]
struct App {
mut:
termui &termui.Context = unsafe { 0 }
termui &termui.Context = unsafe { nil }
snake Snake
rat Rat
width int