Replies: 1 comment
|
The below code is also interesting. I would expect that the Teal compiler would detect the type mismatch and generate a compile time error. But the code compiles and runs successfully. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Why are nested records of type
metatable<T>, while top-level records are not?Is this behavior (and the rationale behind it) documented somewhere?
Thanks!
Here is an example.
[ UPDATE: I guess this example is not particularly practical or useful. In order to be useful, the record's table (for example:
C.D) needs to be set to the__indexfield of a separate metatable table. However, the example still does expose curious and unexpected behavior by the compiler. ]Here is what happens when I try to
tl runthe above code.All reactions