Please don't use internal FunctionElementImpl
Closed this issue · 6 comments
scheglov commented
If this is not an issue with the current code anymore, please roll DartDoc into Dart SDK.
~/Source/Dart/sdk.git/sdk (aa-elements-ElementImpl)$ d-b-sdk64
Generating Xcode projects took 29ms
Done. Made 639 targets from 134 files in 1937ms
Proxy started successfully.
buildtools/ninja/ninja -C xcodebuild/ReleaseARM64 -j1000 -l64 create_sdk
ninja: Entering directory `xcodebuild/ReleaseARM64'
[455/469] ACTION //utils/dartdev:generate_dartdev_snapshot_dill(//build/toolchain/mac:clang_arm64)
FAILED: gen/utils/dartdev/generate_dartdev_snapshot.dart.dill
python3 ../../build/gn_run_binary.py compiled_action ../../tools/sdks/dart-sdk/bin/dart -Dsdk_hash=0000000000 --dfe=../../tools/sdks/dart-sdk/bin/snapshots/kernel-service.dart.snapshot gen/utils/gen_kernel/bootstrap_gen_kernel.dill --packages=../../.dart_tool/package_config.json --platform=vm_platform_strong.dill --no-aot --no-embed-sources --no-link-platform --output=gen/utils/dartdev/generate_dartdev_snapshot.dart.dill --depfile=gen/utils/dartdev/generate_dartdev_snapshot.dart.dill.d -Dsdk_hash=0000000000 -Ddart.vm.product=false ../../pkg/dartdev/bin/dartdev.dart
Command failed: /Users/scheglov/Source/Dart/sdk.git/sdk/tools/sdks/dart-sdk/bin/dart -Dsdk_hash=0000000000 --dfe=../../tools/sdks/dart-sdk/bin/snapshots/kernel-service.dart.snapshot gen/utils/gen_kernel/bootstrap_gen_kernel.dill --packages=../../.dart_tool/package_config.json --platform=vm_platform_strong.dill --no-aot --no-embed-sources --no-link-platform --output=gen/utils/dartdev/generate_dartdev_snapshot.dart.dill --depfile=gen/utils/dartdev/generate_dartdev_snapshot.dart.dill.d -Dsdk_hash=0000000000 -Ddart.vm.product=false ../../pkg/dartdev/bin/dartdev.dart
exitCode: 254
output: ../../third_party/pkg/dartdoc/lib/src/model/canonicalization.dart:104:47: Error: The getter 'enclosingElement2' isn't defined for the class 'FunctionElementImpl'.
- 'FunctionElementImpl' is from 'package:analyzer/src/dart/element/element.dart' ('../../pkg/analyzer/lib/src/dart/element/element.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'enclosingElement2'.
ancestor = (ancestor.wrappedElement.enclosingElement2
^^^^^^^^^^^^^^^^^
[457/469] ACTION //utils/analysis_server:analysis_server(//build/toolchain/mac:clang_arm64)srawlins commented
Hmm, I'm not sure what should be done here. How did you get that crash? Is dartdoc broken at HEAD?
Where is FunctionElementImpl used in dartdoc? The line 104 in the stack trace looks like:
if (ancestor is LocalFunctionElementImpl) {
ancestor = (ancestor.wrappedElement.enclosingElement2
as ExecutableElementImpl)
.element;
} else {
ancestor = ancestor.enclosingElement2;
}Are any of these APIs being deprecated?
scheglov commented
I guess wrappedElement of LocalFunctionElementImpl was FunctionElementImpl.
So, it looks that the higher level issue is using LocalFunctionElementImpl, it is still not API.
srawlins commented
Ah ok, so dartdoc should stop referring to LocalFunctionElementImpl.
srawlins commented
I think I can remove many *Impl references here.
scheglov commented
Thank you :-)