Commit 7463eaf2

7463eaf29072Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 3 files · ~1 modified · -2 deleted

Description

Revert "feat(codegen): emit <obj>.class as a class-name string literal"

This reverts commit e2a36d6be9266dc2794581553e43d52f319848b6.

Details

Commit
7463eaf29072
Parent
ae1a0f329f3d

spinel_codegen.rbmodifiedView file

@@ -3013,18 +3013,6 @@
30133013 end
30143014 end
30153015
3016- # `<obj>.class` returns the class name as a string (Spinel
3017- # collapses Class/Module objects to their textual name; the
3018- # only consumers in practice are interpolation
3019- # `"#<#{self.class}>"` and `.to_s.split` chains, both of
3020- # which work fine on a plain string).
3021- if recv >= 0 && mname == "class"
3022- rt = infer_type(recv)
3023- if is_obj_type(rt) == 1
3024- return "string"
3025- end
3026- end
3027-
30283016 # `recv.__sp_ieval_<N>(...)`: the rewritten form of an
30293017 # `recv.instance_eval { ... }` call. v1 only fired on top-level call
30303018 # sites, where the call's value was always discarded — so its return
@@ -28205,16 +28193,6 @@
2820528193 arrow = "->"
2820628194 if @cls_is_value_type[ci] == 1
2820728195 arrow = "."
28208- end
28209- # `<obj>.class` — collapse to the class name as a string
28210- # literal. Spinel doesn't allocate runtime Class objects,
28211- # but the typical consumers (interpolation in inspect,
28212- # `.to_s.split("::").last` shape) all treat the result as
28213- # a string. Underscore-flattened nested module names
28214- # (`Optcarrot_NES`) render as-is rather than the original
28215- # `Optcarrot::NES` form; the loss is cosmetic.
28216- if mname == "class"
28217- return c_string_literal(cname)
2821828196 end
2821928197 # attr_reader
2822028198 readers = @cls_attr_readers[ci].split(";")