Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exessive long warning message #1838

Closed
Rathoz opened this issue Jan 20, 2023 · 0 comments
Closed

Exessive long warning message #1838

Rathoz opened this issue Jan 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Rathoz
Copy link
Contributor

Rathoz commented Jan 20, 2023

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Type Checking

Expected Behaviour

Getting only this warning

This variable is defined as type `string`. Cannot convert its type to `nil`.
- `nil` cannot match `string`
- `nil` cannot match any subtypes in `string`

Actual Behaviour

Getting this beauty
image

Reproduction steps

local Countries = require('countries')
local str = Countries.CountryName('dummy')
str = nil

Return value of .CountryName is automatically inferred to by the Intellisense to:

""|"Afghanistan"|"Africa"|"Albania"|"Algeria"|"American Samoa"|"Andorra"|"Angola"|"Anguilla"|"Antarctica"|"Antigua and Barbuda"|"Argentina"|"Armenia"|"Aruba"|"Ascension Island"|"Asia"|"Asia-Pacific"|"Australia"|"Austria"|"Azerbaijan"|"Bahamas"|"Bahrain"|"Bangladesh"|"Barbados"|"Belarus"|"Belgium"|"Belize"|"Benelux"|"Benin"|"Bermuda"|"Bhutan"|"Bolivia"|"Bonaire, Sint Eustatius and Saba"|"Bosnia and Herzegovina"|"Botswana"|"Bouvet Island"|"Brazil"|"British Indian Ocean Territory"|"Brunei"|"Bulgaria"|"Burkina Faso"|"Burundi"|"CIS"|"Cabo Verde"|"Cambodia"|"Cameroon"|"Canada"|"Cayman Islands"|"Central African Republic"|"Central America"|"Central Asia"|"Chad"|"Chile"|"China"|"Christmas Island"|"Cocos (Keeling) Islands"|"Colombia"|"Comoros"|"Congo"|"Cook Islands"|"Costa Rica"|"Croatia"|"Cuba"|"Curaçao"|"Cyprus"|"Czechia"|"Côte d'Ivoire"|"Democratic Republic of the Congo"|"Denmark"|"Djibouti"|"Dominica"|"Dominican Republic"|"East Asia"|"Ecuador"|"Egypt"|"El Salvador"|"England"|"English Speaking"|"Equatorial Guinea"|"Eritrea"|"Estonia"|"Eswatini"|"Ethiopia"|"Europe"|"Falkland Islands"|"Faroe Islands"|"Federated States of Micronesia"|"Fiji"|"Finland"|"France"|"French Guiana"|"French Polynesia"|etc...

Additional Notes

No response

Log File

No response

@sumneko sumneko added the bug Something isn't working label Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants