Comments (2)
Seems like an analyzer bug. There is nothing wrong with the type argument to Wrapper
, it's a valid constant type term. (If the spec somehow states that it's not a valid constant type, the bug is also in the spec.)
from sdk.
The ability to "use a generic function type as a type argument" was introduced in Dart 2.14. If you prepend your example with // @dart=2.13
, the VM also gives errors:
a.dart:7:16: Error: A generic function type can't be used as a type argument.
Try using a non-generic function type.
const token1 = Wrapper<TD>();
^
a.dart:8:16: Error: A generic function type can't be used as a type argument.
Try using a non-generic function type.
const token2 = Wrapper<A Function<A>(A)>();
^
I'm not sure how related that is... but it seems maybe we didn't finsh implementing that feature. I thought this issue might be related to the constructor tearoffs feature, introduced in 2.15, in which type variables became potentially constant:
If T denotes a type variable then T is a potentially constant type expression, and a potentially constant expression.
But the VM accepts the program with // @dart=2.14
(pre-constructor-tearoffs), so 🤷 .
from sdk.
Related Issues (20)
- Isolate-local native callables create spurious exception in debugger when returning null HOT 3
- [breaking change] Change the context for the operand of `throw` to `Object`. HOT 1
- Create a method to know if a type is a Built-in type HOT 11
- Contradictory behavior from `body_might_complete_normally` HOT 4
- toStringAsFixed and Number format does not work correctly HOT 2
- [dart:js_interop] Add JSArray.from static method. HOT 1
- Crash while trying to find the compilation unit for an element HOT 1
- Analyzer Feedback from IntelliJ HOT 1
- dart2js memory usage output always 0
- Coverage reports differ when --optimization-counter-threshold=-1 is used HOT 5
- vm/dart/isolates/shared_test flakily fails on vm-reload-linux-release-x64 HOT 3
- Pre-built Stack Class in the Dart Standard Library HOT 2
- Data driven fix: Replacing a method with a getter when method has been removed does not work correctly
- Never-bounded types cause CFE crash
- [dartdev] `Could not find dart. Have you built the full Dart SDK?` on `dart build` HOT 7
- [infra] More frequent dev releases HOT 1
- Consider dropping instructions after return, throw, unreachable, br in wasm_builder
- Consider optimizing `x < 0 || x > positiveInt` to single unsigned comparison
- Analyzer Feedback from IntelliJ HOT 4
- Failures on [dart2wasm] Use unsafeCast in a few places...Reland "[vm] Move `ResolveUri` to bin" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.