diff --git a/spec/compiler/parser/parser_spec.cr b/spec/compiler/parser/parser_spec.cr index 4e69d1a63f3f..fce684fcc0ef 100644 --- a/spec/compiler/parser/parser_spec.cr +++ b/spec/compiler/parser/parser_spec.cr @@ -1500,7 +1500,7 @@ module Crystal assert_syntax_error "case when .foo? then 1; end" assert_syntax_error "macro foo;{%end};end" assert_syntax_error "foo {1, 2}", "unexpected token: ," - assert_syntax_error "pointerof(self)", "can't take pointerof(self)" + assert_syntax_error "pointerof(self)", "can't take address of self" assert_syntax_error "def foo 1; end" assert_syntax_error %<{"x": [] of Int32,\n}\n1.foo(>, "unterminated call", 3, 6 diff --git a/src/compiler/crystal/syntax/parser.cr b/src/compiler/crystal/syntax/parser.cr index bbc0410b9ae2..8abfbd9bd456 100644 --- a/src/compiler/crystal/syntax/parser.cr +++ b/src/compiler/crystal/syntax/parser.cr @@ -5364,7 +5364,7 @@ module Crystal next_token_skip_space_or_newline if @token.keyword?(:self) - raise "can't take pointerof(self)", @token.line_number, @token.column_number + raise "can't take address of self", @token.line_number, @token.column_number end exp = parse_op_assign