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.

Classes can't have an unfulfilled self type with unimplemented methods

See original GitHub issue
trait Bar { def bar: Int }
class Foo { self : Bar => }
2 |class Foo { self : Bar => }
  |      ^
  |   class Foo needs to be abstract, since def bar: => Int is not defined 
one error found

It is allowed in Scalac

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Blaisorbladecommented, Apr 5, 2018

So there is a real use case

To clarify: I mean, one could just require that the class is marked abstract and support the same use cases.

0reactions
griggtcommented, Oct 28, 2020

FWIW, this compiles without error since #8332, both with and without -language:Scala2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

inheritance - Abstract methods in Python - Stack Overflow
Classes derived from this class cannot then be instantiated unless all abstract methods have been overridden. If your class is already using a ......
Read more >
Easiest explanation of Abstract class and Interface - Medium
An abstract class can have one or multiple number of unimplemented methods. As an abstract class is not proper, or does not have...
Read more >
The Practical Difference Between Abstract Classes and Traits ...
An abstract class may or may not have either abstract (unimplemented) or non-abstract (implemented) methods. However, traits also share most ...
Read more >
(PDF) Designing information hiding modularity for model ...
At the present time, there exists no module concept for model transformation languages that allows programmers to control information hiding and strictly ...
Read more >
Text - H.R.7776 - 117th Congress (2021-2022): James M. Inhofe ...
H.R.7776 - James M. Inhofe National Defense Authorization Act for Fiscal Year 2023117th Congress (2021-2022) | Get alerts ...
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