Skip to content

Don't check features when retyping #14675

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

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,7 @@ trait ReChecking extends Checking {
override def checkNoModuleClash(sym: Symbol)(using Context) = ()
override def checkCanThrow(tp: Type, span: Span)(using Context): Unit = ()
override def checkCatch(pat: Tree, guard: Tree)(using Context): Unit = ()
override def checkFeature(name: TermName, description: => String, featureUseSite: Symbol, pos: SrcPos)(using Context): Unit = ()
}

trait NoChecking extends ReChecking {
Expand All @@ -1430,5 +1431,4 @@ trait NoChecking extends ReChecking {
override def checkMembersOK(tp: Type, pos: SrcPos)(using Context): Type = tp
override def checkInInlineContext(what: String, pos: SrcPos)(using Context): Unit = ()
override def checkValidInfix(tree: untpd.InfixOp, meth: Symbol)(using Context): Unit = ()
override def checkFeature(name: TermName, description: => String, featureUseSite: Symbol, pos: SrcPos)(using Context): Unit = ()
}
6 changes: 6 additions & 0 deletions tests/pos-special/fatal-warnings/i14637.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class C

object Givens:
given cOrdering: Ordering[C] with
override def compare(c0: C, c1: C) = 0
val greeting = "we love Givens"