From 51e93f7b6c6264d664e0db909cae94fc18dfd1a0 Mon Sep 17 00:00:00 2001 From: Alexander McCord Date: Wed, 20 Jan 2021 00:34:25 -0800 Subject: [PATCH] This example is complicated. Delete. --- docs/typecheck.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/docs/typecheck.md b/docs/typecheck.md index e8798714..3bd0584d 100644 --- a/docs/typecheck.md +++ b/docs/typecheck.md @@ -108,17 +108,6 @@ print(greetings("Alexander") -- ok print(greetings({name = "Alexander"}) -- not ok ``` -Another example is assigning a value to a local outside of the function: we know `x` and `y` are the same type when we assign `y` to `x`. By calling it, we assigned `x` the value of the argument we passed in. In doing so, we gave `x` a more concrete type, so now we know `x` is whatever type that got passed in. - -```lua -local x -local function f(y) x = y end - -f(1) -- ok -f(2) -- ok -f("foo") -- not ok -``` - ## Table types From the type checker perspective, each table can be in one of three states. They are: `unsealed table`, `sealed table`, and `generic table`. This is intended to represent how the table's type is allowed to change.