Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

invalid override error has wrong line number (class instead of method) #338

Closed
jmesserly opened this issue Sep 18, 2015 · 2 comments
Closed

Comments

@jmesserly
Copy link
Contributor

I'm looking at SDK errors (#103) and noticed this:

severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.& ((num) → num) is not a subtype of int.& ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.<< ((num) → num) is not a subtype of int.<< ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.>> ((num) → num) is not a subtype of int.>> ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.^ ((num) → num) is not a subtype of int.^ ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.abs (() → num) is not a subtype of int.abs (() → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.sign (() → num) is not a subtype of int.sign (() → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.unary- (() → num) is not a subtype of int.unary- (() → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.| ((num) → num) is not a subtype of int.| ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)

every error says "line 349, col 13" ... well, that happens to be this line:

class JSInt extends JSNumber implements int, double {
@jmesserly
Copy link
Contributor Author

oh, I think it's complaining because we implement int ... hmmm, not sure if it's possible, but ideally we'd have three source locations: the base method (num.&), the incompatible override method (int.&) and the "extends JSNumber implements int" line. anyway ... I guess this is more of a feature request than a bug.

@jmesserly
Copy link
Contributor Author

for now, we probably have other things more important. Once we get these into analysis_server it'll be a lot easier to work through strong mode errors/warnigns.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant