Skip to content

Commit

Permalink
Fix implement inherited abstract methods (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino authored Sep 15, 2023
1 parent cca920e commit 83a61f2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 50 deletions.
9 changes: 9 additions & 0 deletions test/validations/shouldHaveBody.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
object shouldHaveBody {
@Expect(code="shouldHaveBody", level="error")
method noBody()
}

const o = object {
@Expect(code="shouldHaveBody", level="error")
method noBody()
}
50 changes: 0 additions & 50 deletions test/validations/shouldImplementAbstractMethods.wlk

This file was deleted.

41 changes: 41 additions & 0 deletions test/validations/shouldImplementInheritedAbstractMethods.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// abstract class
class A {
method abstractBlah()
}

@Expect(code="shouldImplementInheritedAbstractMethods", level="error")
object anA inherits A {
}

class B inherits A {
method otherAbstract(one, two)
}

@Expect(code="shouldImplementInheritedAbstractMethods", level="error")
object aB inherits B {}


class Animal {
var property nombre
}

object ornitorrinco inherits Animal(nombre = "julian") {}

const o = @Expect(code="shouldImplementInheritedAbstractMethods", level="error") object inherits A {}

const o3 = @Expect(code="shouldImplementInheritedAbstractMethods", level="error") object inherits B {}

const o4 = object inherits Animal(nombre = "firulais") {}

class C {
method abstractBlah(someParam)
}

@Expect(code="shouldImplementInheritedAbstractMethods", level="error")
object aC inherits C {
method abstractBlah() {}
}

const unnamedAC = @Expect(code="shouldImplementInheritedAbstractMethods", level="error") object inherits C {
method abstractBlah() {}
}

0 comments on commit 83a61f2

Please sign in to comment.