0

I'm going through the "targets" (tutorials) at dartlang.org. I'm at Target 6: Get Started with Web UI and have run into an error at step #1 under the section "Set up background compilation in Dart Editor".

Could someone explain why this error is happening, or what I could do to resolve it? The error is below.

Error setting breakpoint at 'main': 'package:logging/logging.dart': 
Error: line 250 pos 24: wrong number of type arguments in type 'Comparable'
class Level implements Comparable<Level> {
                   ^

I have not changed anything in any logging package, nor messed with any Comparable class. What gives?

Danny
  • 3,670
  • 12
  • 36
  • 45

2 Answers2

2

Take a look at this question. I actually don't know why is this happening(If someone of the dart dev team is reading this, please, explain us :D), but it seems that they changed the Comparable interface structure in M3, and forgot to update the logging package ;)

To solve your problem, go to the "logging.dart" file and make this change:

FROM:

class Level implements Comparable<Level> {

TO:

class Level implements Comparable {
Community
  • 1
  • 1
Alexandre Wiechers Vaz
  • 1,587
  • 2
  • 18
  • 21
1

This is probably related to incompatibilities between the version of the SDK you are running and the version of web_ui. If you have the most recent version of both, they work together. If you don't want to use the most recent versions, then you have to explicitly manage the versions in your pubspec.yaml file.

I'm using Dart Editor version: 0.4.0_r18915 and web_ui version: 0.4.0 and it works fine.

Try getting the most recent version of Dart Editor, remove the pubspec.lock file, and run pub install again.

Meanwhile, I will figure out how to strengthen the language in the tutorial about managing versions.

Hope this helps. mem

mem
  • 26
  • 1
  • BTW: would you mind letting me know if this was in fact the problem? Thanks. – mem Feb 28 '13 at 17:07
  • Thanks, @mem. Here's the discussion from the issue I entered on the matter, since you're interested in knowing if this was in fact the problem. http://code.google.com/p/dart/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Area%20Milestone%20Owner%20Summary&groupby=&sort=&id=8845 I don't know how to act on your answer since I don't know how to get the most recent version nor remove the pubspec.lock file (just delete?). Apologies for my ignorance in those matters. – Danny Feb 28 '13 at 18:19
  • 1
    Updating (Go to Dart Editor menu item -> About Dart Editor -> Update button) and then running pub install, then pub update, has resolved the matter. Thanks! Upvote @AlexandreWiechersVaz's comment, in his own answer, for instructions that helped confirm this answer! – Danny Feb 28 '13 at 18:35