Skip to content

fix: Fixed undefined and never error#1

Open
TWEEDOriginal wants to merge 2 commits intobasarat:masterfrom
TWEEDOriginal:master
Open

fix: Fixed undefined and never error#1
TWEEDOriginal wants to merge 2 commits intobasarat:masterfrom
TWEEDOriginal:master

Conversation

@TWEEDOriginal
Copy link

Fixes the following errors:

Line 4: Argument of type 'T' is not assignable to parameter of type 'never'.
Fixed by adding the type to data.

Line 5: Type 'undefined' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'.

Fixed by adding an exclamation mark to the return value of pop. It signifies that the value cannot be null or undefined.

Fixes the following error:

Line 12: `Not all code paths return a value.`

Fixed by adding the type for the return value of area function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant