Skip to content

Weird type warning from Frog #540

@peter-ahe-google

Description

@peter-ahe-google

I noticed the below warning when building Frog:

leg/scanner/listener.dart:536:24: warning: type "EmptyLink$Token" is not assignable to "Link$Node"
    Link<Node> nodes = const EmptyLink<Node>();
                       ^^^^^^^^^^^^^^^^^^^^^^^

I see the following problems:

  1. There should be no warning here. EmptyLink<Node> is a subtype of Link<Node>. Even if the type system was sound.
  2. There are no types named EmptyLink$Token or Link$Node in the entire program. This might be as simple as a toString method that is wrong and EmptyLink$Token may mean EmptyLink<Token>, etc.
  3. If my interpretation in 2. is correct, it looks like there is a problem with canonicalization of parameterized types. Type arguments should be part of the canonicalization algorithm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions