-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Closed
Copy link
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Consider the following code (adapted from https://github.com/dart-lang/sdk/blob/master/pkg/front_end/test/constants/data/function.dart):
T method1<T>(T t) => t;
const function0 = method1;
const int Function(int) instantiation0 = method1;The analyzer computes the same constant value for both function0 and instantiation0. But in fact they are not the same constant. Type inference should determine that in order for method1 to match the declared type of int Function(int), the generic function method1 needs to be instantiated with the type parameter int, so the constant value of instantiation0 should reflect this.
Discovered while adapting the analyzer to use the CFE/dart2js "ID test" framework.
I'm currently working on a CL that demonstrates the bug.
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)