Skip to content

Commit

Permalink
Set 'NoReturn' type to untyped typeof in FixMissingTypes visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
makenowjust committed Oct 16, 2017
1 parent aaa44da commit 2c61942
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/compiler/crystal/semantic/cleanup_transformer.cr
Expand Up @@ -741,12 +741,6 @@ module Crystal
node
end

def transform(node : TypeOf)
node = super
node.bind_to node.expressions
node
end

@false_literal : BoolLiteral?

def false_literal
Expand Down
6 changes: 6 additions & 0 deletions src/compiler/crystal/semantic/fix_missing_types.cr
Expand Up @@ -79,6 +79,12 @@ class Crystal::FixMissingTypes < Crystal::Visitor
end
end

def visit(node : TypeOf)
node.expressions.each &.accept self
node.type = @program.no_return.metaclass unless node.type?
false
end

def visit(node : ASTNode)
true
end
Expand Down

0 comments on commit 2c61942

Please sign in to comment.