erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.62k stars 54 forks source link

Empty class with `@Inheritable` caused panic #386

Closed GreasySlug closed 1 year ago

GreasySlug commented 1 year ago

Describe the bug?

Declaring an empty class inheritable will cause panic

Reproducible code

@Inheritable
C = Class()

Expected result

Invalid error? Is it possible to define empty class with @Inheritable the first place?

Actual result

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', crates\erg_compiler\lower.rs:1722:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', C:\Users\user\Desktop\erg\crates\erg_common\spawn.rs:31:22
error: process didn't exit successfully: `target\debug\erg.exe .\examples\inheri.er` (exit code: 101)

Additional context

No response

Erg version

0.6.3

Python version

Python3.11

OS

Windows 10