Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
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

Description

@jmesserly

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 {

Activity

jmesserly

jmesserly commented on Sep 18, 2015

@jmesserly
ContributorAuthor

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

jmesserly commented on Oct 2, 2015

@jmesserly
ContributorAuthor

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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jmesserly

        Issue actions

          invalid override error has wrong line number (class instead of method) · Issue #338 · dart-archive/dev_compiler