Skip to content

Commit 3e2c32c

Browse files
committed
Add Exception when invalid data is passed to prog builder
1 parent 4d6d300 commit 3e2c32c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mrblib/parse-types.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class TParseType
22
attr_reader :line, :file
33
end
44

5-
class TImport
5+
class TImport < TParseType
66
def initialize(file, line)
77
end
88
def inspect

mrblib/prog-ir.rb

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class ProgIR
88
#Initialize IR instance from parsed QML TInst
99
#representation
1010
def initialize(instance)
11+
raise "Invalid node #{instance.inspect}, please provide a TExtend node" if instance.class == TImport
1112
@IR = []
1213
@cur_id = -1
1314
emit IrNode.new(SC, instance.file, 0, [])

0 commit comments

Comments
 (0)