You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prevent these types from being treated as callable functions (e.g. (f.runtimeType as dynamic)(int) where f is a generic function). Discussed at the end.
These can't be written down yet, but they can come up in inference, for example:
/*=T*/ f/*<T>*/(/*=T*/x) => x;
main() {
var y = f;
y =/*<S>*/(y) => y; // legal
}
I'm not aware of this blocking anything, but for consistentcy with Analyzer we should support it.
Regarding "prevent these types from being treated as callable functions": we may need to split out into its own bug, as it likely requires changing how generic classes look. Generic class types & function typedefs are callable, which was okay because they weren't accessible as first-class values. But universal function types can be gotten from .runtimeType, and will likely have a literal form as well: MyGenericFnType. It's not a huge problem if that value is "dynamically callable", since the Type interface does not say anything about supporting call, but it seems suboptimal.
The reason these types aren't callable is because we fixed this issue in general by returning user-visible Types that wrap our internal types, preventing implementation details from leaking.
From @jmesserly on April 25, 2016 22:15
Initial implementation of #301 may not cover this.
(f.runtimeType as dynamic)(int)
where f is a generic function). Discussed at the end.These can't be written down yet, but they can come up in inference, for example:
Note the generic function expression is #527
I'm not aware of this blocking anything, but for consistentcy with Analyzer we should support it.
Regarding "prevent these types from being treated as callable functions": we may need to split out into its own bug, as it likely requires changing how generic classes look. Generic class types & function typedefs are callable, which was okay because they weren't accessible as first-class values. But universal function types can be gotten from
.runtimeType
, and will likely have a literal form as well:MyGenericFnType
. It's not a huge problem if that value is "dynamically callable", since the Type interface does not say anything about supporting call, but it seems suboptimal.Copied from original issue: dart-archive/dev_compiler#526
The text was updated successfully, but these errors were encountered: