-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: conflicting types for "Element" #1007
Comments
nice naming conflict :( Assigning to frog, but this is a nasty example of the name collision issues that we've been seeing. cc @munificent. |
IMO, the best fix would be to improve language prefixes so disambiguation is only needed for actual conflicts. As a stopgap we could rename compiler types so they don't conflict with the DOM, but that seems strange, since the compiler is not usually running in the browser. And the DOM steals some good names like "Node" and "Element" Removed Type-Defect label. |
Moved to enhancement because there is a workaround: use prefixes for either frog or the html lib. |
This comment was originally written by [email protected] Workaround looks ok. One problem: you will need to rewrite any files sourced into the current library to reflect the new prefix. |
Removed Area-Frog label. |
Is this a DOM issue? Removed Area-Dart2JS, FromAreaFrog labels. |
This is not a DOM issue. The problem was just that the frog library and the DOM library both have classes named element. The DOM class named Element should stay named element. If you actually wanted to import both dart:html and a compiler containing a class named Element, the right solution is to prefix one of the two libraries ideally with a mechanism that allows only prefixing the actual conflicts. |
So, given import scoping changes and show:, hide: in the pipeline, I expect this will be simple to resolve (once those features are implemented): #import ('dart:html'); Or (f all you wantto worry about prefixing is frogLib.Element) #import('frogLib.dart', hide: ['Element']); |
Agreed. Closed as by design of language prefixing mechanism. Added AsDesigned label. |
Revisions updated by `dart tools/rev_sdk_deps.dart`. http (https://github.com/dart-lang/http/compare/631d4ec..cad7d60): cad7d60 2023-08-26 Alex James Add response status code test (#1009) 5ac7cfe 2023-08-24 Alex James JavaClient stream response body using byte arrays (#1007) 0e6e58a 2023-08-23 Brian Quinlan Don't check the formatting of `ffigen`ed code (#1010) markdown (https://github.com/dart-lang/markdown/compare/faabb1a..56e75df): 56e75df 2023-08-26 Parker Lougheed Standardize CommonMark spec links to https and v0.30 (#553) mockito (https://github.com/dart-lang/mockito/compare/70aabfc..f5abf11): f5abf11 2023-08-28 Nate Bosch Add a best practice sentence about data models tools (https://github.com/dart-lang/tools/compare/e5ce42a..b72fae8): b72fae8 2023-08-24 Danny Tuppeny Export Survey in package:unified_analytics (#151) Change-Id: Id09f2300d3132a101dfaf84d9dc475ba92590aeb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322980 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Devon Carew <[email protected]>
This issue was originally filed by [email protected]
What steps will reproduce the problem?
var query = new Element.tag('input');
breaks the compilation of interact.dart
../../client/html/release/html.dart:11520:1: error: conflicting types for "Element"
interface Element extends Node /*, common.NodeSelector, common.ElementTraversal */
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../frog/element.dart:9:1: error: conflicting types for "Element"
class Element implements Hashable {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What version of the product are you using? On what operating system?
bleeding_edge, revision 2883
Please provide any additional information below.
Problem started 29.12.2011 around noon.
The text was updated successfully, but these errors were encountered: