void PatternCompiler::visit(TypePattern& pattern, int value) { // Evaluate the expected type. int expected = compiler_.makeTemp(); compiler_.compile(pattern.type(), expected); // Test if the value matches the expected type. compiler_.write(pattern.pos(), OP_IS, value, expected, expected); writeTest(pattern, expected); compiler_.releaseTemp(); }
void Scope::visit(TypePattern& pattern, int dummy) { // Resolve the type expression. resolver_.resolve(pattern.type()); }