mirror of
https://github.com/apple/pkl.git
synced 2026-05-03 21:54:19 +02:00
Fix amending module with abstract class (#319)
This fixes an assertion error that gets thrown if: 1. A module declares a class as abstract 2. An amending module does not use that abstract class as a type Underneath the hood, the modifiers of the class/typelias object member is considered different from the modifiers on the VmClass/VmTypeAlias values. The object model skips forcing any explicitly members that are explicitly declared hidden, abstract, or local. However, it _should_ evaluate any abstract classes found in a module. So, it's incorrect to apply the same modifiers on the class to the object member.
This commit is contained in:
12
pkl-core/src/test/files/LanguageSnippetTests/input-helper/modules/Birds.pkl
vendored
Normal file
12
pkl-core/src/test/files/LanguageSnippetTests/input-helper/modules/Birds.pkl
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
module Birds
|
||||
|
||||
abstract class Bird {
|
||||
name: String
|
||||
}
|
||||
|
||||
class Pigeon extends Bird {
|
||||
name = "Pigeon"
|
||||
passenger: Boolean
|
||||
}
|
||||
|
||||
pidgy: Pigeon?
|
||||
1
pkl-core/src/test/files/LanguageSnippetTests/input/modules/amendModule6.pkl
vendored
Normal file
1
pkl-core/src/test/files/LanguageSnippetTests/input/modules/amendModule6.pkl
vendored
Normal file
@@ -0,0 +1 @@
|
||||
amends ".../input-helper/modules/Birds.pkl"
|
||||
1
pkl-core/src/test/files/LanguageSnippetTests/output/modules/amendModule6.pcf
vendored
Normal file
1
pkl-core/src/test/files/LanguageSnippetTests/output/modules/amendModule6.pcf
vendored
Normal file
@@ -0,0 +1 @@
|
||||
pidgy = null
|
||||
Reference in New Issue
Block a user