enhanced class_enter to check indexed type between a class and a superclass

This commit is contained in:
2025-09-16 23:47:50 +09:00
parent 1c8115dbc9
commit 0da9721c9f
4 changed files with 55 additions and 0 deletions

View File

@ -321,3 +321,28 @@ class Kuduro (a (b) c) {
var d e
var(#class) b ##ERROR: syntax error - duplicate class variable name 'b'
}
---
## TODO: some of these can be detected as an error at the compile time..
class[#b] X (a) {
fun[#ci] new() {
## the instance variable is a byte because the class is a byte-oriented class
self.a := -20 ##ERROR: exception not handled - "negative number - -20"
}
}
X:new
---
class[#b] X (a) {
fun[#ci] new() {
## the instance variable is a byte because the class is a byte-oriented class
self.a := -20 ##ERROR: exception not handled - "negative number - -20"
}
}
class Y: X { ##ERROR: exception not handled - "incompatible byte superclass X with oop class"
}