Skip to content

Added a collect overload for constructor assignables. - #2886

Open
rodinaarssen wants to merge 1 commit into
mainfrom
fix/missing-collect-constructor-assignable
Open

rodinaarssen wants to merge 1 commit into
mainfrom
fix/missing-collect-constructor-assignable

Conversation

@rodinaarssen

Copy link
Copy Markdown
Member

Even though the compiler does not support this feature, users can still write it down. An error is generated elsewhere.

Fixes #2510

Even though the compiler does not support this feature, users can still write it down. An error is generated elsewhere
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45%. Comparing base (2acd8f2) to head (6764ad2).

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2886   +/-   ##
=======================================
- Coverage       45%     45%   -1%     
+ Complexity    6786    6776   -10     
=======================================
  Files          843     843           
  Lines        68798   68798           
  Branches     10029   10029           
=======================================
- Hits         31345   31318   -27     
- Misses       35064   35091   +27     
  Partials      2389    2389           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


private void checkAssignment(Statement current, constructor: (Assignable) `<Name name> ( <{Assignable ","}+ arguments> )` , str operator, Statement rhs, Collector c){
c.report(error(current, "Constructor assignable is not supported by the compiler"));
collect(name, arguments, c);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this removed? we might still want to typecheck the expressions in there?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was moved to the newly added collect overload

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

but someone should still go into that part right? like name etc? or is this function never called?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, it's just that the other checkAssignments seem to collect (but not all of them). So I'm trying to pattern match.

But I guess it's wiser to let @PaulKlint review this PR.

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.

Deconstruct a data type crashes the typechecker

2 participants