WEBVTT

00:00.080 --> 00:00.620
Hi everyone.

00:00.620 --> 00:01.160
Welcome back.

00:01.160 --> 00:04.460
In this lecture we will look into the limitations of using VR.

00:04.460 --> 00:09.200
So the number one limitation is that you cannot have var x equal to null.

00:09.290 --> 00:11.870
Because null can be of any type.

00:11.870 --> 00:16.550
You cannot just define null and try to assign that to a var reserved type name.

00:16.550 --> 00:17.630
So this is not allowed.

00:17.630 --> 00:24.020
And another thing is let's say you're going to assign where x equal to ABC.

00:24.140 --> 00:29.120
And then if you try to change a type to something else, let's say if you want to assign x equal to

00:29.150 --> 00:34.700
five, we are trying to change from the string initial info type to another type.

00:34.700 --> 00:37.040
This is also not allowed okay.

00:37.070 --> 00:42.470
And the next thing is that if you go to the top, you cannot use var as an instance variable.

00:42.470 --> 00:45.830
So where in the class properties are not allowed.

00:45.830 --> 00:51.680
So in this case if I try to do this here, the compiler will complain that where is not allowed and

00:51.830 --> 00:54.740
or it cannot even resolve the symbol where.

00:54.770 --> 00:55.130
Okay.

00:55.160 --> 00:55.940
And the.

00:55.940 --> 01:00.500
Another thing is you cannot use where on the function parameters to.

01:00.530 --> 01:05.720
So in this case, let's say if I try to take the string off and try to use where here, this again is

01:05.720 --> 01:09.890
going to give you the same issue cannot resolve symbol where.

01:09.890 --> 01:13.880
So which means where in the function argument is not allowed.

01:13.880 --> 01:18.920
And one more thing which I would like to show you is in the beginning of the lecture I said where is

01:18.920 --> 01:25.320
not a Reserved keywords in this case were equal to Java, so this is still allowed.

01:25.320 --> 01:27.780
So here the compiler is not going to complain.

01:27.780 --> 01:30.390
You cannot use where as a variable.

01:30.540 --> 01:36.120
So these are some of the limitations that you need to be aware of when you are using local variable

01:36.150 --> 01:36.840
type inference.

01:36.840 --> 01:37.830
Using where.

01:37.860 --> 01:40.380
Let me quickly summarize what we have learned so far.

01:40.380 --> 01:46.230
So what I'm going to do, let's go back to the slides and quickly summarize what we have learned as

01:46.230 --> 01:48.000
the limitations of where.

01:48.000 --> 01:54.630
So number one is you cannot have a null value assigned to a where as a type cannot be inferred.

01:54.660 --> 01:56.010
And number two is changing.

01:56.010 --> 01:57.810
The type is not allowed.

01:57.810 --> 02:01.290
Which means if you try to assign a variable to a certain type.

02:01.290 --> 02:06.540
In this case we are assigning where is equal to the hello world, which is a string, and changing that

02:06.540 --> 02:12.300
to a different type is not allowed, and the next thing is where cannot be used as a class property.

02:12.300 --> 02:15.180
Also, you cannot use this at the class level.

02:15.180 --> 02:20.220
So that's one of the reasons why it is named as it is a local variable type inference.

02:20.220 --> 02:26.220
The scope of using where is just local to the functions, and the final one to call out is that where

02:26.250 --> 02:28.260
cannot be used as a function.

02:28.260 --> 02:28.860
Argument two.

02:28.890 --> 02:34.560
So these are the limitations that you need to be aware of anytime you are using where for type inference

02:34.560 --> 02:36.870
or local variable type inference.

02:36.870 --> 02:38.430
This marks the end of this lecture.

02:38.430 --> 02:39.480
Thank you for watching.
