sassc-ruby icon indicating copy to clipboard operation
sassc-ruby copied to clipboard

undefined method assert_type

Open rubenswieringa opened this issue 9 years ago • 4 comments

assert_type (part of EvaluationContext) causes errors in ruby-extensions.

Test/example:

def test_function_that_asserts_a_type
  engine = Engine.new("$value: attempt_assertion('abc');")
  engine.render
end

private

module Script::Functions
    def attempt_assertion str
      assert_type str, :String
    end
end

Output:

SassC::SyntaxError: Error: error in C function attempt_assertion: undefined method assert_type for SassC::FunctionsHandler::FunctionWrapper:Class

Do you have any pointers on how to make this work in sassc-ruby?

rubenswieringa avatar Jan 08 '16 15:01 rubenswieringa

We don't support this yet. It shouldn't be too difficult, let me look into it.

bolandrm avatar Jan 08 '16 16:01 bolandrm

Cool, that'd be great :)

rubenswieringa avatar Jan 08 '16 16:01 rubenswieringa

I'm working on porting a gem to sassc. But I ran into this issue too.

It's been open since 2016... Has it been implemented in some other way?

ClikeX avatar Oct 15 '19 11:10 ClikeX

No, it's not implemented yet, but PRs are welcome.

bolandrm avatar Mar 03 '20 15:03 bolandrm