Skip to content

Commit 2320b92

Browse files
committed
Add regression test for inheritance crash
Amp-Thread-ID: https://ampcode.com/threads/T-3ff237da-1bb4-43d1-abb5-989b228d9f59
1 parent c72464e commit 2320b92

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# typed: false
2+
3+
# This reproduces a crash where a class inherits from a constant.
4+
# The constant symbol is a static field, not a class/module.
5+
# scip-ruby used to crash when trying to cast this symbol to a ClassOrModuleRef.
6+
7+
Base = Object
8+
9+
class Child < Base
10+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# typed: false
2+
3+
# This reproduces a crash where a class inherits from a constant.
4+
# The constant symbol is a static field, not a class/module.
5+
# scip-ruby used to crash when trying to cast this symbol to a ClassOrModuleRef.
6+
7+
Base = Object
8+
#^^^^ definition [..] Base.
9+
#relation reference=[..] Object#
10+
#^^^^^^^^^^^^^ reference [..] Base.
11+
# ^^^^^^ reference [..] Object#
12+
13+
class Child < Base
14+
# ^^^^^ definition [..] Child#
15+
end

0 commit comments

Comments
 (0)