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.

cannot instantiate Contextual.Using in a subclass

See original GitHub issue

As reported by @LisiLisenok, this code does not compile:

class MyContextual<Element>(Element init) 
        extends Contextual<Element>() {
    shared void f() {
        try(Using(init)){}
    }
}

A workaround is to write try(super.Using(init)){}.

If I copy/paste Contextual into my own project, the code is accepted. I therefore suspect that the bug must be in the model loader.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
FroMagecommented, Nov 8, 2016

It’s OK I have a fix now that I understand what’s supposed to happen.

0reactions
FroMagecommented, Nov 8, 2016

Done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't instantiate subclass of NSManagedObject - Stack Overflow
To use a Swift subclass of the NSManagedObject class with your Core Data model, prefix the class name in the Class field in...
Read more >
Issue with Instantiation of a Class in Workflow - SAP Community
I created a subclass of CL_HRASR00_WF_PROCESS_OBJECT to include some of my custom methods to be used in the workflow.
Read more >
Chapter 8. Classes - Oracle Help Center
1.1) and must be declared abstract if it is incompletely implemented; such a class cannot be instantiated, but can be extended by subclasses....
Read more >
What is Context in Android? - GeeksforGeeks
It allows us to interact with other Android components by sending messages. It gives you information about your app environment. The code has ......
Read more >
10.4 Abstract Classes and Methods - Programming - InformIT
These classes cannot be used to instantiate objects, because, as we'll soon see, abstract classes are incomplete. Subclasses must declare ...
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