forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: If0c0967e55038d330fef48d97bc96a92b0f4b506 Reviewed-on: https://dart-review.googlesource.com/49860 Commit-Queue: Johnni Winther <[email protected]> Reviewed-by: Sigmund Cherem <[email protected]>
- Loading branch information
1 parent
7689dc9
commit 91bbc79
Showing
5 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:async_helper/async_helper.dart'; | ||
import 'package:compiler/src/commandline_options.dart'; | ||
import 'package:compiler/src/common_elements.dart'; | ||
import 'package:compiler/src/compiler.dart'; | ||
import 'package:compiler/src/elements/entities.dart'; | ||
import 'package:compiler/src/world.dart'; | ||
import 'package:expect/expect.dart'; | ||
import '../memory_compiler.dart'; | ||
|
||
const String source = ''' | ||
class Mixin<T> { | ||
void method(T t) {} | ||
} | ||
class Super {} | ||
class Class extends Super with Mixin<int> {} | ||
main() { | ||
new Class().method(0); | ||
} | ||
'''; | ||
|
||
main() { | ||
asyncTest(() async { | ||
CompilationResult result = await (runCompiler( | ||
memorySourceFiles: {'main.dart': source}, options: [Flags.strongMode])); | ||
Expect.isTrue(result.isSuccess); | ||
Compiler compiler = result.compiler; | ||
ClosedWorld closedWorld = compiler.backendClosedWorldForTesting; | ||
ElementEnvironment elementEnvironment = closedWorld.elementEnvironment; | ||
ClassEntity cls = | ||
elementEnvironment.lookupClass(elementEnvironment.mainLibrary, 'Class'); | ||
ClassEntity mixin = | ||
elementEnvironment.lookupClass(elementEnvironment.mainLibrary, 'Mixin'); | ||
FunctionEntity method = elementEnvironment.lookupClassMember(cls, 'method'); | ||
Expect.isNotNull(method); | ||
Expect.equals(mixin, method.enclosingClass); | ||
Expect.isFalse(method.isAbstract); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters