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.

Crash related to XML in given

See original GitHub issue

Compiler version

3.0.0, 3.1.0, 3.1.2, 3.2.0-RC1

Minimized code

libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.1.0"
trait Renderer[A]:
  def render(x: A): xml.Elem

given Renderer[Int] with
  def render(x: Int) = <td>{ x.toString }</td>

Output (click arrow to expand)

error while checking  extends Renderer[Int] {
  def render(x: Int) =
    {
      {
        new _root_.scala.xml.Elem(null, "td", _root_.scala.xml.Null, $scope,
          false
        ,
          {
            val $buf = new _root_.scala.xml.NodeBuffer()
            $buf.&+(
              {
                x.toString
              }
            )
            $buf
          }*
        )
      }
    }
}

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
som-snyttcommented, Jul 4, 2022

The off-by-one span error on Windows suggests maybe lineSeparator is involved, as it adds a CR to NL?

It works for me under WSL Ubuntu; I’m much too lazy to try it under bare Windows. Or rather, my instinct for self-preservation is just strong enough.

(For other newbies, I see the position check at parser is compile-time true, not a compiler option.)

0reactions
som-snyttcommented, Jul 24, 2022

The problem seems to be https://github.com/lampepfl/dotty/pull/15635/files#diff-052bd0d14090dbcf9a970757f11efe267009ee324696dcc3ea785c32eafc770cR77

which is corrected in https://github.com/lampepfl/dotty/pull/15635

It looks like the scala 2 fixes to locate the start of the element are simplified in scala 3, which tracks lastCharOffset.

This would be an example of unfortunate duplicative effort. How many versions of CharArrayReader does one need?

Another divergence is due to \u unicode escape handling. If diffing and porting, it’s nicer for diffs to remain small; the gold standard is still just to share utility code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Why does my XML code crash when its identical to ...
I'm building my first Android program from a book. It kept crashing on an XML file. I downloaded the xml code from the...
Read more >
Crash occur while executing read-xml() - Progress Community
Crash occur while executing read-xml(). While reading an XML in a dataset an application crash occurs. The crash occurs while execution of ...
Read more >
how to crash a program when i open a .xml file - CodeProject
one solution i thought about is to change a type from the project, if a variable is int and i change it to...
Read more >
[XML export crash] "Serious error" on XML export of specific clip
Hi all, When attempting to export an XML of a specific clip , Premiere Pro will crash. It will get to the Final...
Read more >
Crash on trying to add > in a large xml-based file #11221
Huh, you're right; it DOES fix it. Thank you! I'll try to isolate the problem to a specific plugin.
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