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.

Ability to assert over shared attributes

See original GitHub issue

I’m trying to do this:

shared class Foo(X val){
   shared Y y;
   assert(exists y = val.possiblyY());
}

And well, it’s not allowed, so I have to do this stupid code:

shared class Foo(X val){
   assert(exists y_ = val.possiblyY());
   shared Y y = y_;
}

Is it something we could allow or is there another way to do this?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
FroMagecommented, Feb 14, 2016

Or a stef expression:

shared Y y = stef(exists x = f()) x;

Where stef has the same powers as assert but with a cooler name. Ties in well with my other issue about assert in comprehensions…

0reactions
ncoraicommented, Sep 24, 2016

Bumped into this issue today

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I assert that a C# method has a certain attribute?
Yes, with reflection. One possible solution: var dummyAttribute = typeof(YourClassName) .GetMethod(nameof(YourClassName.DummyMethod))! .
Read more >
Assertion Grammars - W3C
This specification provides a basis for defining a group of documents sharing a common syntax for elements and attributes.
Read more >
Power Assertion Parenting & Effects of This Discipline Style
This disciplinary method draws on the parent's physical control and power over material resources.
Read more >
Assertion - Stanford Encyclopedia of Philosophy
We make assertions to share information, coordinate our actions, defend arguments, and communicate our beliefs and desires. Because of its ...
Read more >
Erik Erikson's 8 Stages of Psychosocial Development
The child begins to assert control and power over their environment by planning activities, accomplishing tasks and facing challenges. Success at this stage ......
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