Skip to content

Commit

Permalink
Version 3.3.0-206.0.dev
Browse files Browse the repository at this point in the history
Merge ba78c66 into dev
  • Loading branch information
Dart CI committed Dec 8, 2023
2 parents a6b60fb + ba78c66 commit 2c928cc
Show file tree
Hide file tree
Showing 40 changed files with 925 additions and 160 deletions.
1 change: 1 addition & 0 deletions pkg/analyzer/lib/src/dart/element/type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ class RecordTypeImpl extends TypeImpl implements RecordType {
positionalFields: positionalFields,
namedFields: namedFields,
nullabilitySuffix: nullabilitySuffix,
alias: alias,
);
}

Expand Down
24 changes: 24 additions & 0 deletions pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,30 @@ void test10(Foo? foo, int? a, int b) => foo?[a]![b];
assertTestType(10, 'int?');
}

test_nullCheck_recordType_viaAlias() async {
await assertNoErrorsInCode(r'''
typedef A = (int,);
void f(A? x) {
x!;
}
''');

final node = findNode.postfix('x!');
assertResolvedNodeText(node, r'''
PostfixExpression
operand: SimpleIdentifier
token: x
staticElement: self::@function::f::@parameter::x
staticType: (int,)?
alias: self::@typeAlias::A
operator: !
staticElement: <null>
staticType: (int,)
alias: self::@typeAlias::A
''');
}

test_nullCheck_superExpression() async {
await assertErrorsInCode(r'''
class A {
Expand Down
28 changes: 9 additions & 19 deletions pkg/analyzer/test/src/summary/elements_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46471,39 +46471,29 @@ void f2(Never?<aliasElement: self::@typeAlias::A2, aliasArguments: [int]> a) {}
''');
}

test_typedef_nonFunction_aliasElement_recordType() async {
test_typedef_nonFunction_aliasElement_recordType_generic() async {
var library = await buildLibrary(r'''
typedef A1 = (int, String);
typedef A2<T, U> = (T, U);
void f1(A1 a) {}
void f2(A2<int, String> a) {}
typedef A<T, U> = (T, U);
void f(A<int, String> a) {}
''');

checkElementText(library, r'''
library
definingUnit
typeAliases
A1 @8
aliasedType: (int, String)
A2 @36
A @8
typeParameters
covariant T @39
covariant T @10
defaultType: dynamic
covariant U @42
covariant U @13
defaultType: dynamic
aliasedType: (T, U)
functions
f1 @60
parameters
requiredPositional a @66
type: (int, String)
alias: self::@typeAlias::A1
returnType: void
f2 @77
f @31
parameters
requiredPositional a @96
requiredPositional a @48
type: (int, String)
alias: self::@typeAlias::A2
alias: self::@typeAlias::A
typeArguments
int
String
Expand Down
4 changes: 2 additions & 2 deletions pkg/compiler/lib/src/io/kernel_source_information.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import '../universe/call_structure.dart';
import 'source_information.dart';
import 'position_information.dart';

class KernelSourceInformationStrategy
extends AbstractPositionSourceInformationStrategy {
class OnlineKernelSourceInformationStrategy
extends OnlinePositionSourceInformationStrategy {
late JsToElementMap _elementMap;

@override
Expand Down
Loading

0 comments on commit 2c928cc

Please sign in to comment.