You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indicates that the variable can take on any type. However, it is an error to attempt to do operations on a value of this type or access any properties on it. You also cannot assign it to any other type variable without a cast.
This type checking works only when I use the compilation option --jscomp_error=strictCheckTypes. When I do not use it I can freely access properties, etc. So I am guessing the doc needs a note about the fact that this option must be enabled.
Example without strictCheckTypes option:
/*** @type {*}*/constx=1/*** @type {number}*/consty=x.toString()// This should raise error but does not
It seems the documentation of the ALL type (*) is wrong. It states the following:
Indicates that the variable can take on any type. However, it is an error to attempt to do operations on a value of this type or access any properties on it. You also cannot assign it to any other type variable without a cast.
This type checking works only when I use the compilation option
--jscomp_error=strictCheckTypes
. When I do not use it I can freely access properties, etc. So I am guessing the doc needs a note about the fact that this option must be enabled.Example without
strictCheckTypes
option:Compiler Version: v20221102
Build command:
The text was updated successfully, but these errors were encountered: