Skip to content

Commit

Permalink
Version 3.4.0-225.0.dev
Browse files Browse the repository at this point in the history
Merge f694d3e into dev
  • Loading branch information
Dart CI committed Mar 12, 2024
2 parents a37e067 + f694d3e commit ca54b31
Show file tree
Hide file tree
Showing 17 changed files with 633 additions and 590 deletions.
69 changes: 27 additions & 42 deletions pkg/front_end/lib/src/fasta/builder/class_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,6 @@ abstract class ClassBuilder implements DeclarationBuilder, ClassMemberAccess {
@override
InterfaceType get thisType;

InterfaceType get legacyRawType;

InterfaceType get nullableRawType;

InterfaceType get nonNullableRawType;

InterfaceType rawType(Nullability nullability);

Supertype buildMixedInType(
LibraryBuilder library, List<TypeBuilder>? arguments);

Expand Down Expand Up @@ -277,27 +269,23 @@ abstract class ClassBuilderImpl extends DeclarationBuilderImpl
getAsTypeArguments(cls.typeParameters, libraryBuilder.library));
}

@override
InterfaceType get legacyRawType {
return _legacyRawType ??= new InterfaceType(cls, Nullability.legacy,
new List<DartType>.filled(typeVariablesCount, const DynamicType()));
}

@override
InterfaceType get nullableRawType {
return _nullableRawType ??= new InterfaceType(cls, Nullability.nullable,
new List<DartType>.filled(typeVariablesCount, const DynamicType()));
}

@override
InterfaceType get nonNullableRawType {
return _nonNullableRawType ??= new InterfaceType(
cls,
Nullability.nonNullable,
new List<DartType>.filled(typeVariablesCount, const DynamicType()));
}

@override
InterfaceType rawType(Nullability nullability) {
switch (nullability) {
case Nullability.legacy:
Expand All @@ -319,49 +307,46 @@ abstract class ClassBuilderImpl extends DeclarationBuilderImpl
DartType buildAliasedTypeWithBuiltArguments(
LibraryBuilder library,
Nullability nullability,
List<DartType>? arguments,
List<DartType> arguments,
TypeUse typeUse,
Uri fileUri,
int charOffset,
{required bool hasExplicitTypeArguments}) {
assert(arguments == null || cls.typeParameters.length == arguments.length);
assert(cls.typeParameters.length == arguments.length);
if (isNullClass) {
return const NullType();
}
if (name == "FutureOr") {
LibraryBuilder parentLibrary = parent as LibraryBuilder;
if (parentLibrary.importUri.isScheme("dart") &&
parentLibrary.importUri.path == "async") {
assert(arguments != null && arguments.length == 1);
return new FutureOrType(arguments!.single, nullability);
assert(arguments.length == 1);
return new FutureOrType(arguments.single, nullability);
}
}
DartType type;
if (arguments == null) {
type = rawType(nullability);
} else {
if (aliasedTypeWithBuiltArgumentsCacheNonNullable != null &&
nullability == Nullability.nonNullable) {
assert(aliasedTypeWithBuiltArgumentsCacheNonNullable!.classReference ==
cls.reference);
assert(arguments.isEmpty);
return aliasedTypeWithBuiltArgumentsCacheNonNullable!;
} else if (aliasedTypeWithBuiltArgumentsCacheNullable != null &&
nullability == Nullability.nullable) {
assert(aliasedTypeWithBuiltArgumentsCacheNullable!.classReference ==
cls.reference);
assert(arguments.isEmpty);
return aliasedTypeWithBuiltArgumentsCacheNullable!;
}
InterfaceType cacheable =
type = new InterfaceType(cls, nullability, arguments);
if (arguments.isEmpty) {
assert(typeVariablesCount == 0);
if (nullability == Nullability.nonNullable) {
aliasedTypeWithBuiltArgumentsCacheNonNullable = cacheable;
} else if (nullability == Nullability.nullable) {
aliasedTypeWithBuiltArgumentsCacheNullable = cacheable;
}
if (arguments.isEmpty) {
return rawType(nullability);
}
if (aliasedTypeWithBuiltArgumentsCacheNonNullable != null &&
nullability == Nullability.nonNullable) {
assert(aliasedTypeWithBuiltArgumentsCacheNonNullable!.classReference ==
cls.reference);
assert(arguments.isEmpty);
return aliasedTypeWithBuiltArgumentsCacheNonNullable!;
} else if (aliasedTypeWithBuiltArgumentsCacheNullable != null &&
nullability == Nullability.nullable) {
assert(aliasedTypeWithBuiltArgumentsCacheNullable!.classReference ==
cls.reference);
assert(arguments.isEmpty);
return aliasedTypeWithBuiltArgumentsCacheNullable!;
}
InterfaceType type = new InterfaceType(cls, nullability, arguments);
if (arguments.isEmpty) {
assert(typeVariablesCount == 0);
if (nullability == Nullability.nonNullable) {
aliasedTypeWithBuiltArgumentsCacheNonNullable = type;
} else if (nullability == Nullability.nullable) {
aliasedTypeWithBuiltArgumentsCacheNullable = type;
}
}

Expand Down
5 changes: 5 additions & 0 deletions runtime/bin/directory.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ class Directory {
enum ExistsResult { UNKNOWN, EXISTS, DOES_NOT_EXIST };

static void List(DirectoryListing* listing);

#if defined(DART_HOST_OS_WINDOWS)
static ExistsResult Exists(const wchar_t* path);
#endif

static ExistsResult Exists(Namespace* namespc, const char* path);

// Returns the current working directory. The caller must call
Expand Down
Loading

0 comments on commit ca54b31

Please sign in to comment.