Skip to content

[analyzer][Extension types] No error if the representation type is a bottom type #53823

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

Closed
sgrekhov opened this issue Oct 23, 2023 · 3 comments
Closed
Assignees
Labels
feature-extension-types Implementation of the extension type feature legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Oct 23, 2023

According to the extension types feature specification

A compile-time error occurs if the representation type of an extension type declaration is a bottom type.

But there is no such error in analyzer

extension type ET1(Never _) {} // No error

extension type ET2<T extends Never>(T _) {} // No error

Related CFE issue #53824

Tested on Dart SDK version: 3.3.0-edge.849459109a364f7f80ca82647ad088a4a6157ebc (be) (Sat Oct 21 02:18:48 2023 +0000) on "macos_x64"

@bwilkerson
Copy link
Member

@scheglov

@bwilkerson bwilkerson added the P2 A bug or feature request we're likely to work on label Oct 23, 2023
@scheglov scheglov self-assigned this Oct 23, 2023
@scheglov
Copy link
Contributor

I don't understand why you don't see errors here.
The change landed as 13791e4.

I see it when try IntelliJ, and from cli.

scheglov@scheglov-macbookpro4:~/Source/Dart/sdk.git/sdk (master)$ /Users/scheglov/Source/Dart/sdk.git/sdk/xcodebuild/ReleaseARM64/dart-sdk/bin/dart analyze /Users/scheglov/dart/test/bin/test.dart
Analyzing test.dart...                 0.4s

  error • test.dart:1:20 • The representation type can't be a bottom type. Try specifying a different type. • extension_type_representation_type_bottom
  error • test.dart:3:37 • The representation type can't be a bottom type. Try specifying a different type. • extension_type_representation_type_bottom

2 issues found.
scheglov@scheglov-macbookpro4:~/Source/Dart/sdk.git/sdk (master)$ /Users/scheglov/Source/Dart/sdk.git/sdk/xcodebuild/ReleaseARM64/dart-sdk/bin/dart --version
Dart SDK version: 3.3.0-edge.d37620ed0301133324e153349ec1eb7c26a559c0 (be) (Mon Oct 23 16:45:47 2023 +0000) on "macos_arm64"

@sgrekhov
Copy link
Contributor Author

Retested on the freshly built SDK. No this issue in analyzer now. Probably I tested it on SDK without this change. Sorry for this. Closing as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-extension-types Implementation of the extension type feature legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants