From 38cf7961671133102542df774e6d1ee7a66ad821 Mon Sep 17 00:00:00 2001 From: T045TN1NJ4 Date: Wed, 19 Mar 2025 15:49:27 -0400 Subject: [PATCH 1/2] Update type-checking.md --- content/en-us/luau/type-checking.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en-us/luau/type-checking.md b/content/en-us/luau/type-checking.md index 49cf65e91..edd0a7918 100644 --- a/content/en-us/luau/type-checking.md +++ b/content/en-us/luau/type-checking.md @@ -17,11 +17,11 @@ type Vector2 = {x: number, y: number} There are three Luau type inference modes that can be set on the first line of a `Class.Script`: -- `--!nocheck` - Don't check types -- `--!nonstrict` - Default mode for all scripts, only asserts variable types if they are explicitly annotated +- `--!nocheck` - Default mode for all scripts; don't check types +- `--!nonstrict` - Only asserts variable types if they are explicitly annotated - `--!strict` - Asserts all types based off the inferred or explicitly annotated type -The default mode for the type checker is `--!nonstrict`. The other two modes control how strict the type checker is with inferring and checking types for variables and functions. Any type mismatches in scripts are highlighted in the [Script Editor](../studio/script-editor.md) and surfaced as warnings in the [Script Analysis](../studio/script-editor.md#script-analysis) window. +The default mode for the type checker is `--!nocheck`. The other two modes control how strict the type checker is with inferring and checking types for variables and functions. Any type mismatches in scripts are highlighted in the [Script Editor](../studio/script-editor.md) and surfaced as warnings in the [Script Analysis](../studio/script-editor.md#script-analysis) window. ## Types From 879b586d563c726b7eb9639e2ea61a7bf6dca280 Mon Sep 17 00:00:00 2001 From: IgnisRBX <43388550+IgnisRBX@users.noreply.github.com> Date: Thu, 20 Mar 2025 07:45:40 -1000 Subject: [PATCH 2/2] Apply suggestions from code review --- content/en-us/luau/type-checking.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/en-us/luau/type-checking.md b/content/en-us/luau/type-checking.md index edd0a7918..66328673b 100644 --- a/content/en-us/luau/type-checking.md +++ b/content/en-us/luau/type-checking.md @@ -17,11 +17,11 @@ type Vector2 = {x: number, y: number} There are three Luau type inference modes that can be set on the first line of a `Class.Script`: -- `--!nocheck` - Default mode for all scripts; don't check types -- `--!nonstrict` - Only asserts variable types if they are explicitly annotated -- `--!strict` - Asserts all types based off the inferred or explicitly annotated type +- `--!nocheck` — Don't check types. +- `--!nonstrict` — Only asserts variable types if they are explicitly annotated. +- `--!strict` — Asserts all types based off the inferred or explicitly annotated type. -The default mode for the type checker is `--!nocheck`. The other two modes control how strict the type checker is with inferring and checking types for variables and functions. Any type mismatches in scripts are highlighted in the [Script Editor](../studio/script-editor.md) and surfaced as warnings in the [Script Analysis](../studio/script-editor.md#script-analysis) window. +The `--!nonstrict` and `--!strict` modes control how strict the type checker is with inferring and checking types for variables and functions. Any type mismatches in scripts are highlighted in the [Script Editor](../studio/script-editor.md) and surfaced as warnings in the [Script Analysis](../studio/script-editor.md#script-analysis) window. ## Types