Remove abstract properties (#1781)

This commit is contained in:
Jen Basch
2026-07-29 15:05:19 -07:00
committed by GitHub
parent f6107b6e86
commit 50a09f59dc
24 changed files with 80 additions and 179 deletions
@@ -1,5 +0,0 @@
class Foo {
abstract bar: Int
}
res = new Foo { bar = 5 }
@@ -1 +0,0 @@
abstract foo: Int
@@ -0,0 +1 @@
abstract function foo(): Int
@@ -18,7 +18,7 @@ res3 = f(List(1, 2))
res4 = f(Set(1, 2))
abstract class Animal {
abstract size: String
size: String
abstract function walk(): String
}
@@ -1,8 +0,0 @@
–– Pkl Error ––
Cannot define an abstract member in a non-abstract class.
x | abstract bar: Int
^^^^^^^^
at abstractMemberInNonAbstractClass#Foo (file:///$snippetsDir/input/errors/abstractMemberInNonAbstractClass.pkl)
A member can only be `abstract` if its enclosing class is also `abstract`.
@@ -1,8 +0,0 @@
–– Pkl Error ––
Cannot define an abstract member in a non-abstract class.
x | abstract foo: Int
^^^^^^^^
at abstractMemberInNonAbstractModule (file:///$snippetsDir/input/errors/abstractMemberInNonAbstractModule.pkl)
A member can only be `abstract` if its enclosing class is also `abstract`.
@@ -1,5 +1,5 @@
–– Pkl Error ––
Cannot define an abstract member in a non-abstract class.
Cannot define an abstract method in a non-abstract class.
x | abstract function bar(): Int
^^^^^^^^
@@ -0,0 +1,8 @@
–– Pkl Error ––
Cannot define an abstract method in a non-abstract module.
x | abstract function foo(): Int
^^^^^^^^
at abstractMethodInNonAbstractModule (file:///$snippetsDir/input/errors/abstractMethodInNonAbstractModule.pkl)
A member can only be `abstract` if its enclosing class is also `abstract`.