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

Generate unknown type diagnostic for checked explicit constructors #42756

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nipunayf
Copy link
Contributor

Purpose

$title.

Fixes #42705

Approach

The unknownTypeRefs are updated even during silent type checking, which in result excludes relevant unknown type diagnostics. With the changes, the respective set is only updated if the diagnostic log is not muted.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@nipunayf nipunayf added the Team/LanguageServer Language Server Implementation related issues. #Compiler label May 15, 2024
@nipunayf nipunayf changed the title Generate unknown type for checked explicit constructors Generate unknown type diagnostic for checked explicit constructors May 15, 2024
Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.26%. Comparing base (f22f3e8) to head (93b8d2f).
Report is 61 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #42756      +/-   ##
============================================
- Coverage     77.26%   77.26%   -0.01%     
  Complexity    51301    51301              
============================================
  Files          2928     2928              
  Lines        204391   204392       +1     
  Branches      26659    26660       +1     
============================================
- Hits         157925   157921       -4     
- Misses        37885    37888       +3     
- Partials       8581     8583       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -624,7 +624,7 @@ public boolean isNotUnknownTypeRef(BLangUserDefinedType td) {
Location pos = td.pos;
LocationData locationData = new LocationData(td.typeName.value, pos.lineRange().startLine().line(),
pos.lineRange().startLine().offset());
return unknownTypeRefs.add(locationData);
return dlog.isMute() || unknownTypeRefs.add(locationData);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this reflect the function signature?

Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added Stale and removed Stale labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/LanguageServer Language Server Implementation related issues. #Compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Ambiguous compiler error when instantiating a class that does not exist
2 participants