Skip to content

Instantly share code, notes, and snippets.

@osscontributor
Created September 19, 2014 15:14
Show Gist options
  • Save osscontributor/4504f68ceca7467f2daa to your computer and use it in GitHub Desktop.
Save osscontributor/4504f68ceca7467f2daa to your computer and use it in GitHub Desktop.
trait $ cat SomeTrait.groovy
trait SomeTrait {
int getMagicNumber() {
42
}
}
trait $ cat SomeClass.groovy
class SomeClass implements SomeTrait {
static magicNumber = 'Forty Two'
}
trait $ groovyc SomeClass.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
SomeClass.groovy: 1: Can't have an abstract method in a non-abstract class. The class 'SomeClass' must be declared abstract or the method 'int getMagicNumber()' must be implemented.
@ line 1, column 1.
class SomeClass implements SomeTrait {
^
1 error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment