Broken DeMorgans' Law intention
See original GitHub issueWith a code
fn main() {
let a = b <caret>|| true;
}
after selecting DeMorgans’ Law exception was thrown:
Failed to create expression from text: `!(!a && !true)`
java.lang.IllegalStateException: Failed to create expression from text: `!(!a && !true)`
at org.rust.lang.core.psi.RsPsiFactory.createExpression(RsPsiFactory.kt:19)
at org.rust.ide.intentions.DemorgansLawIntention.applyDemorgan(DemorgansLawIntention.kt:78)
at org.rust.ide.intentions.DemorgansLawIntention.invoke(DemorgansLawIntention.kt:55)
at org.rust.ide.intentions.DemorgansLawIntention.invoke(DemorgansLawIntention.kt:14)
at org.rust.ide.intentions.RsElementBaseIntentionAction$invoke$$inlined$runWriteAction$1.compute(actions.kt:46)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:946)
at org.rust.ide.intentions.RsElementBaseIntentionAction.invoke(RsElementBaseIntentionAction.kt:61)
at com.intellij.codeInsight.intention.PsiElementBaseIntentionAction.invoke(PsiElementBaseIntentionAction.java:42)
at com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper.invoke(IntentionActionWrapper.java:61)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$null$2(ShowIntentionActionsHandler.java:186)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler$$Lambda$928/1181536632.run(Unknown Source)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$3(ShowIntentionActionsHandler.java:191)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler$$Lambda$927/132031337.run(Unknown Source)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:149)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseActionAndInvoke(ShowIntentionActionsHandler.java:185)
at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$0(IntentionListStep.java:276)
at com.intellij.codeInsight.intention.impl.IntentionListStep$$Lambda$922/1897575145.run(Unknown Source)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:204)
at com.intellij.ui.popup.AbstractPopup.lambda$null$7(AbstractPopup.java:1394)
at com.intellij.ui.popup.AbstractPopup$$Lambda$925/562070051.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:843)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:679)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
De Morgan's laws - Wikipedia
In propositional logic and Boolean algebra, De Morgan's laws, also known as De Morgan's theorem, are a pair of transformation rules that are...
Read more >De Morgans Laws Explained - YouTube
In this video I take a look at De Morgan's Laws and methods for simplifying the equations out.
Read more >Proof of De Morgan's Laws - YouTube
De Morgan's laws are 2 laws of logic. They can be derived from the axioms of classical logic and that is the topic...
Read more >Infinite DeMorgan laws - Mathematics Stack Exchange
The first thing to do is the write and understand the definitions of all the symbols in the equation. Let us recall those:....
Read more >DeMorgan's Laws | Mathematics for the Liberal Arts
Still, De Morgan is given credit for stating the laws in the terms of modern formal logic, and incorporating them into the language...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, here’s the commit: https://github.com/intellij-rust/intellij-rust/commit/4c8e733f7eb97a2502da5a417bea908888e5f0e4.
No, it’s ok now.