question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect handling of `end <id>`

See original GitHub issue

Compiler version

scala-3.0.1-RC1 (https://github.com/lampepfl/dotty/commit/83acd4b9e9e7af49f3702022c0ef08209f123f29)

Minimized code

This code shouldn’t have been compiled, but it did:

class C {
}
end C

And automatic rewriting (-rewrite -no-indent) does not delete the end. For this code:

class C:
  val foo: Int = 0
end C

After compiling with scalac -rewrite -no-indent:

class C {
  val foo: Int = 0
}
end C

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
som-snyttcommented, May 6, 2021

Sorry, I didn’t cite the reference doc for end: https://dotty.epfl.ch/docs/reference/other-new-features/indentation.html#the-end-marker

I understand the quote merely to imply that end is not intended as an alternative to brace, so I think the example ought to compile.

I agree there are varying preferences about the syntax. However, the greatest passions are reserved for comments, and while I am now a satisfied user of the end marker, I shall always recoil at the end comment:

class C {
  LOLOC()  // lots of lines of code
} // end C

It would be especially diabolical if the rewrite not only didn’t remove the end marker, but put it behind a line comment after the brace.

0reactions
som-snyttcommented, Jun 26, 2021

OK

package p {
}
end p

but not

package p:
end p

or

package p
end p

nor

package p
class C
end p
Read more comments on GitHub >

github_iconTop Results From Across the Web

Tentative Nonconfirmations (Mismatches) - E-Verify
If the information is incorrect, close the case and select the statement indicating the information was not correct. After the case is closed, ......
Read more >
Form 50058 Tenant ID Management FAQs - IMS/PIC - HUD
Tenant ID Management is based on the principle that IMS/PIC will accept the suspect ... However, if the ID remains invalid, at the...
Read more >
Improper Error Handling - OWASP Foundation
Improper handling of errors can introduce a variety of security problems for a web site. The most common problem is when detailed internal...
Read more >
CWE-119: Improper Restriction of Operations within ... - MITRE
Check buffer boundaries if accessing the buffer in a loop and make sure there is no danger of writing past the allocated space....
Read more >
ITIL incident management process: 8 steps with examples
Identify when an incident is a problem and convert the incident ticket to a problem ticket. If the incident is resolved, confirm the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found