You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnobject.NewError("%d:%d:%s: runtime error: use statement can only be used in a class", node.Token.Line, node.Token.Column, node.Token.File)
14
+
}
15
+
16
+
vartraits []*object.Trait
17
+
18
+
for_, trait:=rangenode.Traits {
19
+
if!scope.Environment.Has(trait.Value) {
20
+
returnobject.NewError("%d:%d:%s: runtime error: trait '%s' is not defined", trait.Token.Line, trait.Token.Column, trait.Token.File, trait.Value)
21
+
}
22
+
23
+
identifier, _:=scope.Environment.Get(trait.Value)
24
+
25
+
t, ok:=identifier.(*object.Trait)
26
+
27
+
if!ok {
28
+
returnobject.NewError("%d:%d:%s: runtime error: referenced identifier in use not a trait, got=%T", trait.Token.Line, trait.Token.Column, trait.Token.File, trait)
0 commit comments