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

Adds Function Call Type Validation #839

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

markwpearce
Copy link
Collaborator

Adds Function Call Type Validation when enableTypeValidation is true

  • new method ScopeValidator.validateFunctionCalls() is called when enableTypeValidation is true
  • Uses Expression.getType() to get the types of a function's arguments
  • Validates against the function's parameters using the BscType.isTypeCompatible() methods
  • When enableTypeValidation is true parameter count mismatches are also handled in new method instead of in Scope.ts
  • Adds new spec file ScopeValidator.spec.ts
image

@markwpearce markwpearce changed the base branch from master to typing-phase2 July 11, 2023 12:30
@markwpearce markwpearce merged commit 09975f2 into typing-phase2 Jul 14, 2023
@markwpearce markwpearce deleted the function_call_validation branch July 14, 2023 19:27
TwitchBronBron added a commit that referenced this pull request Jul 17, 2023
* BinaryExpression returns runtime type of lhs and rhs

* Added symbolTable type check for binary expressions

* Added unary expression getType()

* Deal with compound assignments as well

* White space change

* Added pne more test

* More tests

* Added function call validation (#839)

* Refactor of hover processing, using SymbolTables and enableTypeValidation (#828)

* Refactor of hover processing, using SymbolTables and enableTypeValidation

* build fix

* Uses SymbolTable and TypeChains for hover details

* Build/lint fixes

* Fix failing tests (caused by having wrong types!)

---------

Co-authored-by: Bronley Plumb <[email protected]>
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