question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add validation of implicit `infers` usage

See original GitHub issue

We already validate incorrect explicit usage of returns and infers in #438 – we should validate implicit usage too.

For example, a Definition rule can be defined without a return type, what implicitly means Definition infers Definition.

Definition:
    'def' name=ID ('(' args+=DeclaredParameter (',' args+=DeclaredParameter)* ')')? ':' expr=Expression ';';

If now interface Definition will be declared, we should validate, that the Definition rule has the return type Definition as Definition returns Definition.

Definition returns Definition: ...;

interface Definition {
    name: string
    expr: Expression
    args: DeclaredParameter[]
}

Depends on #440.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
msujewcommented, May 27, 2022

@montymxb I believed this behavior was already added by https://github.com/langium/langium/pull/461. But I agree having a quick fix for this would be great!

1reaction
dhuebnercommented, Apr 1, 2022

We need to fix scoping anyways, currently in your example returns Definition will link to Parser rule Definition 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing with validation problems - Gradle User Manual
Invalid use of cacheable annotation. This error indicates that you have annotated a type with @CacheableTransform on something that is not an artifact...
Read more >
Validation - Laravel - The PHP Framework For Web Artisans
To do this, we will use the validate method provided by the Illuminate\Http\Request object.
Read more >
Can the Implicit Association Test Measure Automatic ...
Does the IAT measure automatic judgment that typical self-report measures do not measure? In this commentary, we argue that although Schimmack's ...
Read more >
Creating multiple validators for the same constraint - LogicBig
Following example shows how to create multiple validators (multiple implementations of ConstraintValidators ) for the same constraint.
Read more >
Error Explanations for The W3C Markup Validation Service
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found